views:

1170

answers:

3

Hi! I've enabled the django request processor TEMPLATE_PROCESSORS = ( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.request", ) Still i don't have to request variable available in templates. I've to manually pass it. Using django 1.0.2 Everywhere on web it seems it's only about enabled request processor..

Also i am using RequestContext as :

 return render_to_response(
    'profile.html',
    {
        'persons':Person.objects.all(),
        'person':Person.objects.get(id=id),
         'request':request,
    },
    context_instance=RequestContext(request)
)

no luck

ohh darn the new name for that is

TEMPLATE_CONTEXT_PROCESSORS

+1  A: 

TEMPLATE_CONTEXT_PROCESSORS instead of TEMPLATE_PROCESSORS

Attila
A: 

Are you sure you don't have the request variable available to the template? What happens when you remove the line

'request':request,

that's different from when that line is present. If your template loads the same either way, the problem is with your template.

David Berger
+1  A: 

settings.py:

TEMPLATE_CONTEXT_PROCESSORS = (
  # ...
  'django.core.context_processors.request',
  # ...
)
Dingo