Reputation: 789
So normally in a website, I make and in the CSS, I do
#logo {
background: url(../images/logo.jpg);
}
however, no since I am using a django project, my image is in
C:\Users\me\Documents\mysite\myapp\static\images
and my .css file is in
C:\Users\me\Documents\mysite\myapp\static\css
in settings.py, my static_root is
STATIC_ROOT = 'C:/Users/me/Documents/mysite/myapp/static'
I tried doing
#logo {
background: url({{ STATIC_URL }}/images/logo.jpg);
}
but that didn't work. Any idea what I'm doing wrong and how to fix it?
Upvotes: 1
Views: 130
Reputation: 1360
Since you have both directories in the same path "static", just do as usual:
#logo {
background: url(../images/logo.jpg);
}
Upvotes: 3