简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM