Zombie SharedDataMiddleware on Python Heroku

Viewed 512

I'm setting up a Flask app on Heroku. Everything is working fine until I added static files. I'm using this:

from werkzeug import SharedDataMiddleware
app = Flask(__name__)
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {'/static': os.path.join(os.path.dirname(__file__), 'static') })

The first time I deploy the app, the appropriate files in the ./static will be available at herokuapp.com/static. But after that initial deploy, the files never change on Heroku. If I change the last line to:

app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {'/assets': os.path.join(os.path.dirname(__file__), 'static') })

a new URL for the static files, herokuapp.com/assets, then I can see the updated files.

It seems like a mirror of the files gets stuck in the system. I've changed it four times and can access all of the URLs still.

1 Answers
Related