[Answered ]-Why “accounts/login/?next=/” is coming in url of Django on local development server ? | Way to remove “accounts/login/?next=/” from the url

1👍

just add this to your settings.py

LOGIN_URL = 'login'

From Django Docs:

The URL or named URL pattern where requests are redirected for login when using the login_required() decorator…

see: https://docs.djangoproject.com/en/4.1/ref/settings/#login-url

0👍

because you have used this in urls.py

path('login/', CustomLoginView.as_view(), name='login')

just remove this url it will be fixed

use this for admin login

path('admin/', admin.site.urls)

Leave a comment