1
While deploying your app first change DEBUG=FALSE
in your setting file.
Following link can be useful.
https://devcenter.heroku.com/articles/django#deploy-to-heroku
0
To serve static files I highly recommend you to use whitenoise http://whitenoise.evans.io/en/stable/django.html
STATIC_ROOT = os.path.join(PROJECT_PATH, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
MIDDLEWARE_CLASSES = [
# 'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
# ...
]
No need to run collectstatic
as heroku will do that for you. What that does is puts all the files into the STATIC_ROOT
for you (all compressed and with a hashed file name for long expires).
- [Django]-Implement get_serializer in generic list view (generics.ListCreateAPIView) in Django REST Framework
- [Django]-Using HttpResponseRedirect, but browser is not showing correct URL
- [Django]-Django can not delete csrftoken after logout
- [Django]-Django session lost when redirected from facebook oauth
Source:stackexchange.com