Can't make path right in css on django site

Issue

I’m working in django, and I have one page that I have inputed css in html file, and from there I need to call background image (to be honest did not work with css in a while). However I make path is not working, even put photo in same folder with html file, created new one, nothing. I would like to put it in Django_site/static/images/1.jpg. Currently I’m in Django folder Django_site/Django_app/templates/Django_app/my.html.
What do you suggest?

.bgimg {
  background-image: url('images/1.jpg');
  height: 100%;
  background-position: center;

Solution

 background-image: url("{% static 'images/1.jpg' %}")

Answered By – Def Soudani

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published