我试图回避,但我可以确定我的问题。 许多人面临这一问题,并试图遵循他们的指示,但我仍然可以这样做。 因此,我的组合存在任何问题?
--环境
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
STATIC_ROOT = os.path.join(PROJECT_PATH, static )
STATIC_URL = /static/
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages")
- 概 况
render_to_response( authen/login.html ,context_instance=RequestContext(request))
--——————
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}styles/reset.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}styles/root.css" />
--
[16/Apr/2012 21:27:26] "GET /authen/login.php HTTP/1.1" 200 1391
[16/Apr/2012 21:27:26] "GET /static/styles/reset.css HTTP/1.1" 404 1652
[16/Apr/2012 21:27:26] "GET /static/styles/root.css HTTP/1.1" 404 1649
页: 1
if settings.DEBUG:
urlpatterns += patterns( django.contrib.staticfiles.views ,
url(r ^static/(?P<path>.*)$ , serve ),
)