cssdjangodjango-viewsdjango-templatesdjango-static

How to convert a div css line to django template line for this particular line?


I want to convert a particular template line containing and inline css into django template line which will show the static files too. The template line is

<div class="single-welcome-slides bg-img bg-overlay jarallax" style="background-image: url(img/bg-img/1.jpg);">

What will be the django static template line to load the image?


Solution

  • Maybe You can try something like this

    <div class="single-welcome-slides bg-img bg-overlay jarallax" style="background-image: url({% static 'img/bg-img/1.jpg' %});" />
    

    Happy Coding!