I tried using a style sheet served as a static file with the tutorial
project. In settings.py, I defined STATIC_URL = /static/ and
STATICFILES_DIRS = ('/path/to/project/static/',). Then I defined a
base_html template with a line in the HEAD of the form
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}
style.css" />
and put style.css in directory /static/. Finally, I defined
index.html, detail.html, etc., as given in the tutorial to each extend
base.html.
Everything works perfectly, except that only one template
(detail.html) correctly processes the {{ STATIC_URL }} value to find /
static/style.css. In every other template, {{ STATIC_URL }} evaluates
to the empty string, giving just style.css, which does not exist of
course.
Every template extends the single base template in the same way. So
why does {{ STATIC_URL }} work for some templates and not others?
Rodney
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.