Django template CSS/IMG is "off" in the URL
Posted
by
erimar77
on Stack Overflow
See other posts from Stack Overflow
or by erimar77
Published on 2012-05-31T04:36:46Z
Indexed on
2012/05/31
4:40 UTC
Read the original article
Hit count: 151
django
|django-templates
I have
/path/to/my/theme/static/css/frontend.css
which is called by base.html
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/frontend.css" media="all" />
In which I've got a background for the header:
#header-wrapper
min-width: 960px;
height: 150px;
background: transparent url(img/header-bg.png) repeat-x center bottom;
}
The file is
/path/to/my/theme/static/img
I've run manage.py collectstatic to gather the files and almost everything looks correct except the link generated looks like: http://example.com/static/css/img/header-bg.png
In which the image does not show, because the correct URL is: http://example.com/static/img/header-bg.png
Where am I going wrong??
© Stack Overflow or respective owner