You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the deployment happening, but with some limitations:
The app deployed, but the admin looked funny (no static)
I looked up the code and you're using whitenoise, but not configuring it. It's been mentioned before.
I added this manually to my settings:
import os
if 'ON_HEROKU' in os.environ:
...
+ # from https://whitenoise.evans.io/en/stable/#quickstart-for-django-apps, install whitenoise after SecurityMiddleware
+ i = MIDDLEWARE.index("django.middleware.security.SecurityMiddleware")
+ MIDDLEWARE.insert(i + 1,"whitenoise.middleware.WhiteNoiseMiddleware")
Heroku will automatically run collectstatic as part of the push:
0.5.8 fixes the issue with static resources being made available for the admin site, and the larger whitenoise middleware issue. Thank you for the nice clean way to modify middleware as well! I also deployed your test project using 0.5.8, and it worked.
I tried out the heroku deployment on a very smol sample project https://github.com/glasnt/django-simple-project
I got the deployment happening, but with some limitations:
The app deployed, but the admin looked funny (no static)
I looked up the code and you're using
whitenoise
, but not configuring it. It's been mentioned before.I added this manually to my settings:
Heroku will automatically run collectstatic as part of the push:
So once I ran this, the admin looked okay again:
The other issue I had is that because blank database, I had no django admin login.
I know I can fix this in heroku by running
heroku run python manage.py createsuperuser
and interactively re-create the admin user, which I did.My simple app contained a Procfile already, so this file was not overridden (but it also already ran locally).
Still to do:
The text was updated successfully, but these errors were encountered: