27👍
I had a similar error and the logs said ValueError: Missing staticfiles manifest entry for
…
Changing STATICFILES_STORAGE in settings.py
from: STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
to: STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
as described in this section of whitenoise docs fixed it for me.
Also you probably want to change your SECRET_KEY now that it’s shared publicly.
3👍
Change for fast solution:
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
to:
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
But! It will generate static files without unique chunk keys for correct updating in client browser (e.g. style.343a1fa2da70.css) and client won’t see changes after without refreshing site cache. WhiteNoise only adds a thin wrapper around Django’s storage to add compression support, and because the compression code is very simple it generally doesn’t cause problems. So you need
- Return
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
- Clear staticfiles folder manually
- Refresh static assets by
py manage.py collectstatic --noinput
- Enjoy!
- In Django, how can I prevent a "Save with update_fields did not affect any rows." error?
- Django runserver custom database
- Is it correct to modify old migration files in Django?
- Why does S3 (using with boto and django-storages) give signed url even for public files?
2👍
Most answers above would get your app back up and running, but you may not end up achieving the same result as you may have intended especially if you wanted to leverage the static files caching strategy.
The reason you got the internal server error is that, before adding Whitenoise you had run python manage.py collectstatic
which by default used; STATICFILES_STORAGE='django.contrib.staticfiles.storage.StaticFilesStorage'
Therefore to maintain your setting to STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
, just run python manage.py collectstatic
again.
The Django docs here should give you more visibility.