On Thu, Apr 16, 2009 at 8:25 AM, Col Wilson <col.wilson.em...@googlemail.com> wrote: > > I'm using generic views to render my pages > (django.views.generic.date_based, django.views.generic.list_detail > etc) and they're very handy. > > However, the app I'm trying to build would like a security and on > reading the "User Authentication in Django" document, it just talks > about adding authentication to the views. > > Generic views of course are buried in the django installation > directories and you don't want to go messing about in there, so it's > not obvious to me how I can do that. > > Can someone give me a hand please? > > >
Middleware would be one option. You could write a process_view function that checks request.user and redirects requests with no authentication. This will all happen before the view gets called. More here: http://docs.djangoproject.com/en/dev/topics/http/middleware/#process-view Colin --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---