On 20/07/10 12:11, barun wrote: > > [gallery/views.py] > def index(request): > return render_to_response('base.html', {}) >
You have to pass through a RequestContext() for the template context processor that injects MEDIA_URL ('django.core.context_processors.media') into to the template to kick in, and you have to have said template context processor in your settings.TEMPLATE_CONTEXT_PROCESSORS (it is by default). i.e. you should be doing return render_to_response( 'base.html, {}, context_instance=RequestContext(request)) It may well be that pretty much every view you write needs the relevant boilerplate. It's not like it's hard to define your own function to hide the verbosity, but some days I kind of wish it was the default (the reason it isn't is probably something to do with performance). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.