Set up Login System in Django

From TRCCompSci - AQA Computer Science
Revision as of 17:25, 12 April 2019 by Admin (talk | contribs) (Created page with "=Update urls.py= You will need to add the following to your urls.py file: <syntaxhighlight lang=python> from django.contrib import admin from django.urls import path, includ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Update urls.py

You will need to add the following to your urls.py file:

from django.contrib import admin
from django.urls import path, include # might need to add just include
from django.views.generic.base import TemplateView # add this line

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/', include('django.contrib.auth.urls')), # add this line
    path('', TemplateView.as_view(template_name='home.html'), name='home'), # add this line
]