Re: Accessing User Object From Template

2008-07-12 Thread Chris

On Jul 12, 11:30 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> Are you using RequestContext, not Context, as mentioned here:

Nope, thanks for the clarification. I guess I misinterpreted the
technicality note that says that's the default.

Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Accessing User Object From Template

2008-07-12 Thread Karen Tracey
On Sat, Jul 12, 2008 at 11:12 PM, Chris <[EMAIL PROTECTED]> wrote:

>
> According to http://www.djangoproject.com/documentation/authentication/
> each template should have access to the variable "user" by default.
> However, after I login, this variable doesn't seem to be defined. Is
> there any special configuration required to have access to this? The
> only weird thing I imagine I could be doing is using
> render_to_response in my view. Would that be blocking the context from
> being populated correctly?
>

Are you using RequestContext, not Context, as mentioned here:

http://www.djangoproject.com/documentation/authentication/#authentication-data-in-templates

?

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Accessing User Object From Template

2008-07-12 Thread Peter Rowell

> The only weird thing I imagine I could be doing is using
> render_to_response in my view. Would that be blocking the context from
> being populated correctly?

Nothing weird about that. Try reading the following section:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext

And in particular, read about django.core.context_processors.auth.
Then you can {{user}} to your heart's content.

HTH,
Peter
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Accessing User Object From Template

2008-07-12 Thread Chris

According to http://www.djangoproject.com/documentation/authentication/
each template should have access to the variable "user" by default.
However, after I login, this variable doesn't seem to be defined. Is
there any special configuration required to have access to this? The
only weird thing I imagine I could be doing is using
render_to_response in my view. Would that be blocking the context from
being populated correctly?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---