Saturday, July 31, 2010

Re: Get request path without having a request object

Just add django.core.context_processors.request to your
TEMPLATE_CONTEXT_PROCESSORS, this way you can access the current
request object in your template, you will have to use however
RequestContext class with render_to_response,

From docs:


If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every
RequestContext will contain a variable request, which is the current
HttpRequest. Note that this processor is not enabled by default;
you'll have to activate it.

Carlos Daniel Ruvalcaba Valenzuela

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment