Django Heroku not serving static files when Debug=False

前端 未结 2 1055
别那么骄傲
别那么骄傲 2021-01-07 02:41

I\'m hosting my Django application on Heroku and using whitenoise to handle serving static files.

Following is con

相关标签:
2条回答
  • 2021-01-07 03:33

    Got the solution from a post

    Added collectstatic to Procfile

    web: python manage.py collectstatic --no-input; gunicorn myapp.wsgi --log-file - --log-level debug
    

    And now every static file is serving including, CSS, js, images and videos.

    0 讨论(0)
  • 2021-01-07 03:44

    The Whitenoise middleware should come after the security middleware and before all other middleware. You are currently adding it to the end.

    0 讨论(0)
提交回复
热议问题