0👍
✅
My mistake is i forgot context_instance=RequestContext(request).
If {{ STATIC_URL }} isn't working in your template, you're probably not using RequestContext when rendering the template
1👍
Remove '/Users/IMAC/work3/Blog/Blog/polls/static'
from STATICFILES_FINDERS = (
And your STATIC_ROOT should be
STATIC_ROOT = '/Users/IMAC/work3/Blog/Blog/polls/static/'
and
STATIC_URL = '/static/'
- [Answer]-Django: Can't access cleaned_data even after calling .is_valid
- [Answer]-How to disable/enable input fields of a form dynamically on Django
- [Answer]-Passing user credentials from Tastypie to Django Model
- [Answer]-Python, Django – private media streaming and prevent hijacking
- [Answer]-Django Forms BoundField – Output when iterating over ChoiceField has no id tag
0👍
You’ve misunderstood what the various settings do:
STATIC_FILES_FINDERS
is a list of Python classes which Django uses to search for static files, it is not a list of places where static files are stored.STATIC_ROOT
is the directory where the static files are stored.STATIC_URL
is the URL that should point to the static files.
In your case you want something like this:
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
STATIC_ROOT = '/Users/IMAC/work3/Blog/Blog/polls/static'
STATIC_URL = '/static/'
- [Answer]-Messagebox with Django
- [Answer]-Django throws NoReverseMatch error
- [Answer]-How can I create Django's form at mongoengine?
- [Answer]-Html, csrf token tag is not working. Shows in page
- [Answer]-How to modify all "add another …" text to one generic text in admin
Source:stackexchange.com