List Info

Thread: TEMPLATE_CONTEXT_PROCESSORS




TEMPLATE_CONTEXT_PROCESSORS
user name
2006-07-24 17:13:03

Hi,

I added this to my settings.py:
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
    'django.core.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
)

I took it from the second comment from here:
http://www.dja
ngoproject.com/comments/

The goal is to have request.META.PATH_INFO in templates.

The problem is that TEMPLATE_CONTEXT_PROCESSORS does not
seem to make
any difference. request is still not accessible from
template. Even is
I
set the variable to () nothing happens.

Do you have any idea?

Thanks in advance,
Ray


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

TEMPLATE_CONTEXT_PROCESSORS
user name
2006-07-24 17:25:00
On 7/24/06, Rares Vernica <rvernicagmail.com> wrote:
> The goal is to have request.META.PATH_INFO in
templates.
>
> The problem is that TEMPLATE_CONTEXT_PROCESSORS does
not seem to make
> any difference. request is still not accessible from
template. Even is
> I
> set the variable to () nothing happens.

As far as I know, the TEMPLATE_CONTEXT_PROCESSORS setting
only affects
templates which have a RequestContext object passed to them
by the
view, and not a plain Context object.

The Django generic views all use RequestContext objects, but
if you've
written your own views, then you may be using plain Context
objects,
and your context processors won't be executed at all.

-- 
Regards,
Ian Clelland
<clellandgmail.com>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

TEMPLATE_CONTEXT_PROCESSORS
user name
2006-07-24 17:21:11
On 7/24/06, Rares Vernica <rvernicagmail.com> wrote:
> The problem is that TEMPLATE_CONTEXT_PROCESSORS does
not seem to make
> any difference. request is still not accessible from
template.

Are you sure you're using RequestContext in the view?

-- 
"May the forces of evil become confused on the way to
your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

TEMPLATE_CONTEXT_PROCESSORS
user name
2006-07-31 05:08:18
Hi,

I written my own views. How can I pass a RequestContext
objects, instead 
of a plain Context object, from my view to my template?

Thanks a lot,
Ray

Ian Clelland wrote:
> On 7/24/06, Rares Vernica <rvernicagmail.com> wrote:
>> The goal is to have request.META.PATH_INFO in
templates.
>>
>> The problem is that TEMPLATE_CONTEXT_PROCESSORS
does not seem to make
>> any difference. request is still not accessible
from template. Even is
>> I
>> set the variable to () nothing happens.
> 
> As far as I know, the TEMPLATE_CONTEXT_PROCESSORS
setting only affects
> templates which have a RequestContext object passed to
them by the
> view, and not a plain Context object.
> 
> The Django generic views all use RequestContext
objects, but if you've
> written your own views, then you may be using plain
Context objects,
> and your context processors won't be executed at all.
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )