May 2018
Beginner to intermediate
526 pages
11h 57m
English
We are going to use Django's authentication framework in our platform. Both instructors and students will be instances of Django's User model, so they will be able to log in to the site using the authentication views of django.contrib.auth.
Edit the main urls.py file of the educa project and include the login and logout views of Django's authentication framework:
from django.contrib import adminfrom django.urls import pathfrom django.contrib.auth import views as auth_viewsurlpatterns = [ path('accounts/login/', auth_views.LoginView.as_view(), name='login'), path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('admin/', admin.site.urls),]
Read now
Unlock full access