Reputation: 11
please help me with this. I have an image slider. it shoud add like this bellow..
<div class="slider-item" style="background-image: url('img/hero_2.jpg');">
<div class="container">
<div class="row slider-text align-items-center justify-content-center">
<div class="col-md-8 text-center col-sm-12 element-animate">
<h1>Delecious Food</h1>
<p class="mb-5">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi unde impedit, necessitatibus, soluta sit quam minima expedita atque corrupti reiciendis.</p>
<p><a href="#" class="btn btn-white btn-outline-white">Get Started</a></p>
</div>
</div>
</div>
</div>
Not working like these ways
<div class="slider-item" style="background-image: url({%static'/img/hero_1.jpg'%});">
or
<div class="slider-item" style="background-image: url{%static'/img/hero_1.jpg'%}">
I don't want to add like an img tag like this way " <img src="{% static '/img/hero_2.jpg' %}" />"
Thank you
Upvotes: 0
Views: 58
Reputation: 24
Update your settings.py file like given below and run command "python manage.py collectstatic"
Upvotes: 1