Answer the question
In order to leave comments, you need to log in
Why is Django not loading CSS?
Good afternoon.
Probably a boring question, but nevertheless:
Janga 1.7 does not see templates
In settings:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
{% load static files %}
<link rel="stylesheet" type="text/css" href="{% static 'weddidea/css/bootstrap2.min.css' %}" /> <link rel="stylesheet" type="text/css" href="{% static 'weddidea/css/style.css' %}" />
[31/Mar/2015 10:53:42] "GET /static/weddidea/css/style.css HTTP/1.1" 404 1670
Answer the question
In order to leave comments, you need to log in
Usually in the main urls.py you need to insert something like this (to work on a dev server):
After the basic rules
if settings.DEBUG:
urlpatterns += patterns(
'django.views.static',
(r'media/(?P.*)',
'serve',
{'document_root': settings.MEDIA_ROOT}),
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question