﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33376	django.contrib.auth.urls don't function when enclosed within an application namespace.	Yash Pathak	Yash Pathak	"If you define the application namespace in a urls.py file of an app and include the auth URLs provided by Django, they return errors associating to Exception Type: NoReverseMatch.

{{{
from django.urls import path, include
from .apps import UsersConfig

app_name = UsersConfig.name

urlpatterns = [
    path('accounts/', include(""django.contrib.auth.urls"")),
]
}}}

The success_url fails to redirect to the correct url since they are more or less defined in a static manner.

By making a few changes in the auth/views.py file, this issue can be fixed. One additional change, that needs to be done by the developer, is to define the app name in the settings.py file separately(Just like LOGIN_REDIRECT_URL). For Example:

{{{
LOGIN_REDIRECT_URL = 'onboarding'

LOGOUT_REDIRECT_URL = ""onboarding""

AUTH_APPLICATION_NAMESPACE = 'users'
}}}
'users' is the name of my app as defined in the former code snippet."	Cleanup/optimization	closed	contrib.auth	4.0	Normal	duplicate	success_url	Yash Pathak	Unreviewed	1	0	0	0	0	0
