I am running a django project on heroku. After seeing that my favicon.ico won't load, I decided to see if it was working when visiting my page example.com/favicon.ico.
What I saw (on multiple browsers) is a dead image like this: https://app.box.com/s/q9uqb2kmooak93ockvbl
I am serving the favicon.ico like so:
<link rel="shortcut icon" href="{% static 'favicon.ico' %}" type="image/x-icon"/>
Also, I should mention I am redirecting the url in my django project like this:
#serving favicon
(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico')),
That shouldn't matter though.
I am wondering if this is a problem:
- with the image I am trying to render (though I doubt it since other images render fine)
- a problem with heroku
- or a problem with the shortcut icon reference link?
Here are the settings to my static just incase:
STATIC_URL = '/static/'
# only refers to the location where your static files should end up after running manage.py collectstatic. you shouldn't really need collectstatic) when developing locally
STATIC_ROOT = 'staticfiles'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, '../static'),
)
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(BASE_DIR, '../templates'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
Any ideas?