Document how this conflicts/integrates with `contrib.auth` URLs
See original GitHub issueLet’s say I have a pretty typical Django project with django.contrib.auth
URLs, like this:
urlpatterns = [
url(r'^accounts/', include('django.contrib.auth.urls')),
]
As you can see from the source code of auth.urls
, it provides these URLs:
login
logout
password_change
password_change_done
password_reset
password_reset_done
password_reset_confirm
password_reset_complete
This is exactly the same list as the URLs provided by registration.auth_urls
, just with the auth_
prefix:
auth_login
auth_logout
auth_password_change
auth_password_change_done
auth_password_reset
auth_password_reset_done
auth_password_reset_confirm
auth_password_reset_complete
However, if I search for auth_login
, auth_logout
, or any of these previous URL names, I cannot find any of them documented.
All the auth_
URLs point to django.contrib.auth
views, so it doesn’t seem like auth_
views are necessary. They use the same template names (registration/login.html
, etc.) Interesting, the regexes are slightly different (r'^password/change/$'
instead of r'^password_change/$'
).
It seems like this should be the suggested URL config:
urlpatterns = [
url(r'^accounts/', include('django.contrib.auth.urls')),
url(r'^accounts/', include('registration.backends.hmac.urls')), # change backend if desired
# ...
]
That way, the existing registration/login.html
template does not need to be changed, and {% url "login" %}
does not need to be changed to {% url "auth_login" %}
.
Is my understanding correct? If so, I would be glad to submit a documentation pull request.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Just directly using the contrib.auth URLs would be backwards-incompatible; I’m leaving this open to do in django-registration 3.0 since I can break backwards compatibility there. For now,
registration.auth_urls
will emit aDeprecationWarning
.2.4 is out,
master
is now 3.0 prep, and the built-in auth URLconf has been removed.