1π
I think you just forget to add this line to get the static files :
<!DOCTYPE html>
{% load staticfiles %}
You are using the development server (manage.py runserver
) with DEBUG = True
while having this problem, right?
Because with DEBUG = False
or in production environment, the static files should be served by your server, or a CDN, or another server : https://docs.djangoproject.com/en/1.6/howto/static-files/deployment/
If none of this is working, check that your static folder is located where itβs supposed to : https://docs.djangoproject.com/en/1.6/howto/static-files/ (Configure properly the STATIC_ROOT and django.contrib.staticfiles in INSTALLED_APPS or add a static pattern in your ulrpatterns like described in the doc at the link I provided)
0π
Firstly, {% load staticfiles %} should 1st string.
#example.html
{% load staticfiles %}
.....
and collect all staticfiles in project path(where manage.py):
python manage.py collectstatic
- [Answer]-Django rest framework post β Invalid drive specification
- [Answer]-Django tastypie returning 401 always for POST method and works well for GET
- [Answer]-How to download all bucket files using gsutil with django-gae app
- [Answer]-Django Open / Edit record instead of Creating new