[Answered ]-Page not found is showing (django)

2👍

Do this instead of login^$

^login$

0👍

In default, @login_required will redirect the unauthenticated user to settings.LOGIN_URL.
settings.LOGIN_URL set as /accounts/login as default. See the documentation.

Therefore, your login url is /login, then you need to set the LOGIN_URL in setting.py file.

Add this line in the end of setting.py

LOGIN_URL = "/login"

Also, you may want to have a look at the LOGIN_REDIRECT_URL attribute.

Leave a comment