How to use the default authentication system of django


I’m a new user of django. When I try to use the default authentication system, I just follow the document an below link:
I put the code
urlpatterns = [
path(‘accounts/’, include(‘django.contrib.auth.urls’)),
into the which is in the same folder with

Then I tried to run the app. When I visited accounts/login, show me the error

“‘account’ is not a registered namespace”

Yes, I do not create app ‘account’. So I create the app ‘account’.

Visit accounts/login again, then show me error.

Reverse for ‘user_login’ not found. ‘user_login’ is not a valid view function or pattern name.

Here, I know maybe I should create a view named ‘user_login’.

But I think it should be an incorrect way to get the function, because it’s not easy.

I think account app should installed when I installed ‘django.contrib.auth’. There is no need to create an

new ‘account’ app.

How can I get the default authentication easily and fast? Could you send me any demo to guide me to get this?

Thank you very much!

@songhaobat see this step by step tutorial to use Django’s default authentication system: Django Login and Logout Tutorial |

I hope this helps!