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

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -