django.contrib.auth.urls is a ready-made URL module for Django’s authentication and user-management views. Include it in the project URLconf instead of wiring each built-in view manually. section 6.3
Think of it as a bundle of routes: Django supplies the view logic, while your project supplies the matching templates and site-specific appearance. The login route expects registration/login.html. section 6.3
Mount the authentication routes
Add this entry to urlpatterns, commonly beside the admin route: path('accounts/', include('django.contrib.auth.urls')). The login view then becomes available at /accounts/login/. Create templates/registration/login.html with a POST form containing {% csrf_token %}, {{form.as_p}}, and a submit button.
When a protected view redirects an unauthenticated visitor to login, Django adds a next query parameter so successful authentication can return the visitor to the original URL. section 6.3
