1 from django
.contrib
.auth
.views
import logout_then_login
, login
2 from django
.conf
import settings
6 self
.login_path
= settings
.LOGIN_URL
7 def process_request(self
, request
):
8 if request
.user
.is_anonymous() and request
.path
!= self
.login_path
:
12 return HttpResponseRedirect('%s?next=%s' % (self
.login_path
, request
.path
))
14 # vim: set ts=4 sw=4 et: