Edit the urls.py of your account application, like this:
from django.urls import pathfrom django.contrib.auth import views as auth_viewsfrom . import viewsurlpatterns = [ # previous login view # path('login/', views.user_login, name='login'), path('login/', auth_views.LoginView.as_view(), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'),]
We comment out the URL pattern for the user_login view we have created previously to use the LoginView view of Django's authentication framework. We also add a URL pattern for the LogoutView view.
Create a new directory inside the templates directory of your account application and name it registration. This is the default path where the Django authentication ...