Missing staticfiles manifest entry for 'website/images/favicon.ico'
jakespeers opened this issue · 2 comments
Hi there,
I'm running into an issue with integrating whitenoise with my live production app. I have been using it since the beginning, but am now try to add in caching by adding
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
I'm now at a point where I've changed so many settings around trying to fix the errors that I'm not even sure where to go anymore. Hopefully someone can see the (most likely simple) error I've made.
my base settings:
STATIC_URL = '/static/'
MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware',
INSTALLED_APPS = [ 'whitenoise.runserver_nostatic',
my local settings:
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
my production settings:
I have them set as following just so it is still live and working with no error. The below does NOT give an error
STATIC_ROOT = os.path.join(BASE_DIR, 'static/') STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
Im first trying to get it to work on local before i set it in production. With static_root set to 'staticfiles' and storage set for caching, it gives me error:
Missing staticfiles manifest entry for 'website/images/favicon.ico'.
My current directory setup is website/static/website/ then I have a folder for fonts, css, images, js, ect.
When I run python manage.py collectstatic it makes a new folder called staticfiles, instead of a subdirectory of website it has admin, which contains css, fonts, img, and js (though I don't recognize the names of the files, for example theres no favicon.ico in the img folder)
Where I try to call favicon in my html:
<link rel="shortcut icon" href="{% static 'website/images/favicon.ico' %}">
Any help greatly appreciated!! I'm at a loss here and it's driving me crazy
Thought I'd add a couple more troubleshooting attempts:
With local debug at True, STATIC_ROOT at 'static/', and STATICFILES_STORAGE using whitenoise, it works.
When I change debug to False, 500 error with 'Missing staticfiles manifest entry for..'
When I change debug back to True, and static_root to staticfiles, no error but also no static files loading. Based on chrome console, an example of the request url is http://127.0.0.1:8000/static/website/css/owl.carousel.css
Got it working..
Some how deleted STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] somewhere along the way, once I re-added it everything worked.