The first time I put the new STORAGES dict in settings, I forgot to remove the old assignment version. After seeing this error, I corrected it.
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
STATIC_URL = "/static/"
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
},
}
However, I still keep getting this exact same error, pretty much no matter what I do.
File “/home/malikarumi/.cache/pypoetry/virtualenvs/chronicle-jltMOQ-O-py3.11/lib/python3.11/site-packages/django/conf/init.py”, line 278, in init
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: STATICFILES_STORAGE/STORAGES are mutually exclusive.
I have been to the White Noise docs. They said:
https://whitenoise.readthedocs.io/en/latest/django.html#troubleshooting-the-whitenoise-storage-backend
To test whether the problems are due to WhiteNoise or not, try swapping the WhiteNoise storage backend for the Django one:
I have tried both
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
and
"BACKEND": "django.core.files.storage.FileSystemStorage"
I even tried hacking the manifest_strict setting out of white noise:
packages/whitenoise/storage.py
def __init__(self, *args, **kwargs):
# manifest_strict = getattr(settings, "WHITENOISE_MANIFEST_STRICT", None)
manifest_strict = False
I also made a commit for the new version of settings. I still got this same error.
I wanted to try a migration, but of course I couldn’t get past check.
The machine has even been rebooted. Nothing works. Always the same error.
ChatGPT suggested the conflict might be coming from somewhere else. like white noise middleware, but I don’t see it.
Django docs suggest subclassing, but they don’t say where to put this subclass so it actually has some effect. But since that’s what white noise has already done, and that failed, I don’t see how that can work for me.
But wait. You haven’t heard the best part: This is NOT my original problem. The original problem was this error I got from Heroku. which generated a 500 error:
2023-08-28T20:59:42.312432+00:00 app[web.1]: ValueError: Missing staticfiles manifest entry for 'admin/css/base.css'
But the local and heroku manifests are identical on this line
local staticfiles.json
"admin/css/base.css": "admin/css/base.64976e0f7339.css",
heroku staticfiles.json
"admin/css/base.css": "admin/css/base.64976e0f7339.css",
and at that point local was coming up with no issues. But now I can’t even run collectstatic, because this error won’t let me run any of those commands.
I am out of ideas. Please help. Thanks.