I would like to authenticate users using django.contrib.auth.views.login
.
I want that when the login is correct I send them to dashboard
. I have the following codes:
In settings:
LOGIN_REDIRECT_URL = '/usuarios/dashboard/'
In Urls Application:
url(r'^usuarios/', include('Usuarios.urls', namespace='usuarios')),
url(r'^login/$','django.contrib.auth.views.login',{'template_name' : 'admin/login.html',},name='login'),
In Users / Urls:
url(r'^dashboard/$', BlankView.as_view(), name='index'),
In Users / View:
class BlankView(TemplateView):
template_name = '/templates/index.html'
At the time of testing I get the login form ok but when I accept it, it sends me the following error:
NoReverseMatch at /usuarios/dashboard/
Reverse for 'logout' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method: GET
Request URL: http://localhost/usuarios/dashboard/
Django Version: 1.9
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'logout' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []