Anton
Anton

Reputation: 2341

Serving static files on heroku

I'm writing a Python app for heroku. Flask is used for the web component of the app.

My problem is that I can't find a way to serve static files. I don't want to do it through flask because that is very inefficient.

I'm also using gunicorn. How would I set up serving of static files?

Upvotes: 7

Views: 6669

Answers (1)

GetItDone
GetItDone

Reputation: 576

Try using Amazon s3 for storing static and media files. A similar question and answer can be found here. Here is heroku's documentation of using s3. Then you might want to disable automatic collectstatic instructions here so collectstatic isn't run every time you push to heroku. Hope this helps.

Upvotes: 8

Related Questions