Django {{ MEDIA_URL }} blank @DEPRECATED

You need to add the RequestContext in your render_to_response for the context processors to be processed.

In your case:

from django.template.context import RequestContext

context = {'latest': p}
render_to_response('Question/latest.html',
                   context_instance=RequestContext(request, context))

From the docs:

context_instance

The context instance
to render the template with. By
default, the template will be rendered
with a Context instance (filled with
values from dictionary). If you need
to use context processors, render the
template with a RequestContext
instance instead.

Leave a Comment