Logo
Blog: {{MEDIA_URL}} blank in Django Template

Are you trying to use the {{MEDIA_URL}} template tag and see it resolving as blank?

You have most likely omitted the third optional argument to your render_to_response call in your underlying view.

Your code is something like this:

 
from django.shortcuts import render_to_response
 
def awesomeView(request):
    return render_to_response('template.html', {})
 

It should be something like this:

 
from django.template import RequestContext
from django.shortcuts import render_to_response
 
def awesomeView(request):
    return render_to_response('template.html', {}, context_instance = RequestContext(request))
 
Blog Index