ក្រុម រូបភាព ការបន្ទាន់សម័យ នានា វ៉ែប ថតឯកសារ
Recently Visited Groups | Help | Sign in
Google Groups Home
Easy way to include Request Context always?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Streamweaver  
View profile  
 More options Jul 5 2009, 11:39 am
From: Streamweaver <streamwea...@gmail.com>
Date: Sat, 4 Jul 2009 21:39:33 -0700 (PDT)
Local: Sun, Jul 5 2009 11:39 am
Subject: Easy way to include Request Context always?
I'm still struggling a bit with template contexts

What I want to do is put a code snippet in the header of my site base
template that either presents the user with a small login form if they
aren't authenticated or display a "Welcome! user" where user is linked
to their profile.

It seems I have to pass RequestContext(request) everytime I call
render_to_response but I'm sure there's an easier way I'm missing.
I've read through the docs and apologize if I'm missing it but can
someone help with some advice?

Thanks in advance.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ronghui Yu  
View profile  
 More options Jul 5 2009, 4:23 pm
From: Ronghui Yu <stone...@gmail.com>
Date: Sun, 05 Jul 2009 17:23:54 +0800
Local: Sun, Jul 5 2009 4:23 pm
Subject: Re: Easy way to include Request Context always?

I had the same problem. I didn't find a built-in way to solve this. But
I think you can implement a custom render_to_response, which calls the
built-in one in turn.
Then what you need to do is just importing your custome one.

Streamweaver ??:

--
Ronghui Yu <mailto:stone...@163.com>

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Streamweaver  
View profile  
 More options Jul 5 2009, 11:42 pm
From: Streamweaver <streamwea...@gmail.com>
Date: Sun, 5 Jul 2009 09:42:36 -0700 (PDT)
Local: Sun, Jul 5 2009 11:42 pm
Subject: Re: Easy way to include Request Context always?
Thanks for the reply.  I thought that might be the case but wanted to
check.

There is a very good blogpost about this very topic at Liconln Loop

http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-t...

but it was made last year and I hoped there was a setting we could
change or set to make it global.

Thanks again.

On Jul 5, 5:23 am, Ronghui Yu <stone...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google