In my urls.py I have this:
(r'^myapp/$', 'myapp.views.views.index'),
(r'^myapp/login/$', 'myapp.views.views.login_user'),
In my settings.py I have this:
LOGIN_URL = '/myapp/login'
In my views.py I have this:
@login_required((login_url='/myapp/login/')
def index(request):
return render_to_response('index.html')
def login_user(request):
#login stuff
return render(request, 'registration/login.html', {'state':state, 'username': username})
I can go to mysite.com/myapp/login and the login page works. However, when I go to mysite.com/myapp/index I do not get redirected to the login page even though I am logged out. Why is that and how do I fix it?