Quisiera autenticar usuarios utilizando django.contrib.auth.views.login
.
Quiero que cuando sea correcto el login los mande a un dashboard
. Tengo los siguientes codigos:
En settings:
LOGIN_REDIRECT_URL = '/usuarios/dashboard/'
En Urls Aplicacion:
url(r'^usuarios/', include('Usuarios.urls', namespace='usuarios')),
url(r'^login/$','django.contrib.auth.views.login',{'template_name' : 'admin/login.html',},name='login'),
En Usuarios/Urls :
url(r'^dashboard/$', BlankView.as_view(), name='index'),
En Usuarios/View :
class BlankView(TemplateView):
template_name = '/templates/index.html'
A la hora de hacer pruebas me sale bien el formulario de login pero al dar aceptar me manda el siguiente 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: []
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name' : 'admin/login.html'})