python - Django template with External CSS ; using {%static%} for images in a division -


i using django web app , encountered no image shown problem following code:

<div class="hexagon-in2" style="background:url(static/images/gallery/2.jpg)"> 

please situation.

if have defined media_url in settings.py

<div class="hexagon-in2" style="background:url("{{ media_url }}/images/gallery/2.jpg)"> 

// or static_url if use static files storing images , media


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -