my settings.py is like this:
import os
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_ROOT = ''
STATIC_URL = '/static/waijiaocrm/'
STATICFILES_DIRS = (
os.path.join(ROOT, '/static/waijiaocrm/')
)
my static files is stored at project/static/waijiaocrm/
static/waijiaocrm
-admin/
-css/
-image/
-js/
my template is like this:
{% load static from staticfiles %}
<link href="{% static 'css/base.css' %}" rel="stylesheet" type="text/css" />
<link href="{% static 'css/login.css' %}" rel="stylesheet" type="text/css" />
my urls.py:
url(r'^login/$', 'django.contrib.auth.views.login',
{'authentication_form': MyAuthenticationForm,
'template_name': 'waijiaocrm/login.html'}, name="login"),
when I run the login, I can only get the login html, without css or image files, I did as the documentation says, but can't get the right page, how to fix this?
[08/May/2013 17:54:10] "GET /accounts/login/ HTTP/1.1" 200 2814
[08/May/2013 17:54:10] "GET /static/waijiaocrm/css/base.css HTTP/1.1" 404 1662
[08/May/2013 17:54:10] "GET /static/waijiaocrm/css/login.css HTTP/1.1" 404 1665
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/lib/jquery-1.8.2.min.js HTTP/1.1" 404 1704
[08/May/2013 17:54:10] "GET /accounts/login/image/crm_logo.png HTTP/1.1" 404 3778
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/lib/jquery.placeholder.min.js HTTP/1.1" 404 1722
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/formValidator.js HTTP/1.1" 404 1683
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/login.js HTTP/1.1" 404 1659
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/lib/jquery.placeholder.min.js HTTP/1.1" 404 1722
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/formValidator.js HTTP/1.1" 404 1683
[08/May/2013 17:54:10] "GET /static/waijiaocrm/js/login.js HTTP/1.1" 404 1659
I finally fixed it,it's because of a wrong template_dir configuration, thank all of you guys for your patience and your time, @Hedde, I really appreciate your layout for your project, and I vote for your answer in the question you linked below.