On Sunday 16 August 2009 03:34:16 am Mirat Bayrak wrote:
> Hi i am working on a website and i am passing *request.user* and a
> *region*object to every template by manually in my every view. Can i
> do it by using
> some other method? i mean i dont want to pass them in every view can django
> do it automatically?
>

Take a look at context processors more deeply:
http://docs.djangoproject.com/en/dev/ref/templates/api/#playing-with-context-objects

there is a user context processor available also.  It sounds like you're using 
them correctly, but if you use the shortcut render_to_response() you can pass 
a RequextContext(request) instance to it that will set them for you, making 
them available in the template you passed to render_to_response().

Mike

-- 
"We never make assertions, Miss Taggart," said Hugh Akston.  "That is
the moral crime peculiar to our enemies.  We do not tell -- we *show*.
We do not claim -- we *prove*."  
-- Ayn Rand, _Atlas Shrugged_

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to