I am testing my django project locally. The templates and static files are as listed:
static/
css/
js/
...
templates/
home.html
...
When I run the server, the html file is loaded but firefox indicate that:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
The html links in my templates are like:
<link rel="stylesheet" href="/static/css/bootstrap.min.css" type="text/css"/>
however, when I input 127.0.0.1:8000/static/css/bootstrap.min.css in the browser, the file actually exists and can be fetched.
[26/Apr/2015 06:47:38]"GET / HTTP/1.1" 200 10125
[26/Apr/2015 06:47:49]"GET /static/css/bootstrap.min.css HTTP/1.1" 200 117150
I have go through some postings on this topic, I have done things below: My settings.py have INSTALLED_APPS:
INSTALLED_APPS = (
'django.contrib.admin',
...
'django.contrib.staticfiles',
'frontend',
'crawler',
}
my urls.py is pasted here:
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = patterns('',
url(r'^$', include('frontend.urls')),
);
urlpatterns += staticfiles_urlpatterns()
What is the problem here?
staticfiles_urlpatterns()doesn't work if it's False.