On 6/29/07, Kirk Strauser <[EMAIL PROTECTED]> wrote: ... > return render_to_response('index.html', > context_instance=RequestContext(request)) ... > > My only concern is that it would seem that I'll need to manually build and > pass in a RequestContext for every single view, since I want to have a login > or logout link at the top of each one. Is that correct?
render_to_response(template_name, context_instance=None, **kwargs) is a shortcut over this: t = get_template(template_name) c = context_instance or Context() c.update(kwargs) return HttpResponse(t.render(c)) So passing in context_instance is still shorter. If you still don't like it, you could use django.views.generic.direct_to_template as the last line instead of render_to_response. I guess I'm old school-- I still generally use the longer form. :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---