[Fixed]-What are the default URLs for Django's User Authentication system?

26πŸ‘

βœ…

If you look at django.contrib.auth.urls you can see the default views that are defined. That would be login, logout, password_change and password_reset.

These URLs are normally mapped to /admin/urls.py. This URLs file is
provided as a convenience to those who want to deploy these URLs
elsewhere.
This file is also used to provide a reliable view deployment for test
purposes.

So you can just hook them up in your urlconf:

url('^accounts/', include('django.contrib.auth.urls')),

As you probably want to customize those views (different form or template), in my opinion you will redefine these urls anyway. But it’s a good starting point nevertheless.

3πŸ‘

Just a heads up this should now be

from django.urls import include
path("accounts/", include("django.contrib.auth.urls")),
πŸ‘€ark

Leave a comment