Look at these sample code , is this you want ?

from django.template import loader, RequestContext
def custom_proc(request):
"A context processor that provides 'app', 'user' and
'ip_address'."
return {
'app': 'My app',
'user': request.user,
'ip_address': request.META['REMOTE_ADDR']
}
def view_1(request):
# ...
t = loader.get_template('template1.html')
c = RequestContext(request, {'message': 'I am view 1.'},
processors=[custom_proc])
return t.render(c)

On Jul 18, 5:52 am, Jon Brisbin <[EMAIL PROTECTED]> wrote:
> I was considering this option, but went with some custom middleware,
> which allows me to mix in some other things I was wanting to add to
> the context as well...
>
> Thanks for the suggestion!
>
> Jon Brisibnhttp://jbrisbin.com
>
> On Jul 17, 2008, at 4:16 PM, gordyt wrote:
>
>
>
> > Jon I don't see why you couldn't make a custom template tag (see
> >http://tinyurl.com/2zlzf6).  I made one to display the current
> > application revision and so to use it in a template is just this:
>
> > {% revision %}
>
> > --gordon

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to