On Tue, May 20, 2008 at 7:14 PM, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > If you want to use HTTP Basic authentication, then put everything > under/behind Apache and use Apache to do it. If you want to use form > based authentication with same user database across all applications > gets a bit harder. Which do you want?
It's actually not that hard, even if you want to require auth only for specific areas. A middleware like this might do the trick (with a little tweaking): from django.contrib.auth.decorators import login_required class AuthRequiredMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): if ... (fill in test here to see if it's a URL or view you want to require auth for): return login_required(view_func)(request, *view_args, **view_kwargs) -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---