In settings.py

STATIC_DOC_ROOT = os.path.join(os.path.dirname(__file__), “static”)

MEDIA_URL = ‘/static/’

——————–

In urls.py
from django.conf import settings
if settings.DEBUG:
urlpatterns += patterns(”,
(r’^static/(?P<path>.*)$’, ‘django.views.static.serve’, {‘document_root’: settings.STATIC_DOC_ROOT }),
)

————-

In template .html

<h1><a href=”/”><img src=”{{ MEDIA_URL }}images/logo.png” alt=”Your Logo” title=”Your website”/></a></h1>

———-

directory structure

yourapp/static/images/

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 Web Oom Suffusion theme by Sayontan Sinha
Switch to our mobile site
Top Footer