Hi, Thanks for your immediate reply. I've seen the document and followed the steps in it already. But was not able achieve any progress. In
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}), does site_media mean the directory in which the template exists or the url of the template according to the urls.py file Actually i have a form in the url http://127.0.0.1:8000/identity/franchisebook. Once the user fills the form, in the franchisebook function, I'm redirecting the variables into a print.html file through render_to_response(). And i want to display an image in that file. This print.html resides in templates directory(of course all templates are in "templates" directory). Below are some things I've tried out (r'^identity/franchisebook/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), (r'^identity/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), (r'^identity/print.html/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), (r'^identity/franchisebook/print.html/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), So what do i have to specify in the place of site_media? I have tried all the possible replacemetns. But i was not able to achieve any progress. Please help me out. Thanks, nazgi On May 17, 12:48 am, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On May 16, 7:37 pm, newbie <mara.ku...@gmail.com> wrote: > > > Hi, > > > I want to display an image from static files directory in a > > template. The name of the image is stored in a variable(say image). > > When i try to display it in the template using img tag( src = > > {{ image }} ), its not displayed. Can someone help me in this regard. > > > Thanks, > > nazgi. > > http://docs.djangoproject.com/en/dev/howto/static-files/ > -- > DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---