How to use the default authentication system of django

Hello,

I’m a new user of django. When I try to use the default authentication system, I just follow the document an below link:
https://docs.djangoproject.com/en/3.2/topics/auth/default/#built-in-auth-forms
I put the code
urlpatterns = [
path(‘accounts/’, include(‘django.contrib.auth.urls’)),
]
into the urls.py which is in the same folder with settings.py

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 | LearnDjango.com

I hope this helps!