> Something like this (i didn't check if this code works):
>
> from django.conf import settings
> from django.http import HttpResponseRedirect
>
> class MaintenanceMiddleware(object):
>      def process_request(self, request):
>          if settings.MAINTENANCE:
>              if not request.user.is_authenticated():
>                  return HttpResponseRedirect('/maintenance/')
>      return None
>
> Put this middleware after AuthenticationMiddleware in the settings.py

Of course, this would work, but it also prevents users not logged in from 
logging in. Is there a way to check if the user is accessing the login view, 
in order to let him access his account and the site being under maintenance?

Thanks,
Chris Hoeppner
www.pixware.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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