I suggest you that you use path in the url file. I made an implemantation
of login like this
from django.urls import include, path
from django.contrib.auth import views as auth_views
from generales.views import Home, SinPrivilegios, HomeSinPrivilegios
urlpatterns = [
path('', Home.as_view(), name='home'),
path('login/',
auth_views.LoginView.as_view(template_name='generales/login.html'),
name='login'),
path('logout/', auth_views.LogoutView.as_view
(template_name='generales/login.html'), name='logout'),
path('sin_privilegios/', HomeSinPrivilegios.as_view(),
name='sin_privilegios')
]
How you can see, just import the auth views (wiht aliases) and just put in
parameter the name of the template_name. And work for me.
All this (and more) I covered in my course about Django 2.1,
https://goo.gl/oeT5Sx Take a look. It is in spanish, but may be I can
help you if you register.
El miércoles, 10 de octubre de 2018, 20:38:05 (UTC-6), Yonggang Dai
escribió:
>
> HI! I am having issues with django login . I want to use the default
> login class with the html file "login.html". But I meet the below issue.
> Please help me to fix it. Thanks a lot.
>
> [image: image.png]
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/0e242e16-d070-4ce7-91fe-fc2ce479fdcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.