How can I use login() method for other function in views.py?

I used login(request, user) to attach the user id to the current session. But I don’t know how can I use this method for other functions in views.py.
Django doc doesn’t mention what type of return of the method.
I tried to use testing tools but I don’t know how can I define a request.
Thanks

What is it that you’re trying to accomplish here? I don’t understand what your objective is - or why you think it may be necessary to do this.

Actually, I have two forms. one is loginform includes a username and password and another one is a form that the user wants to fill in many fields and then save to the database. like many apps in the world, once a user login into the login form and then the user is not required to fill login form every time.
I can solve this problem by session manually. but while I’, reading Django’s doc, I faced a part of the docs that refer to login() method.
https://docs.djangoproject.com/en/4.0/topics/auth/default/#how-to-log-a-user-in-1
I wonder what is it? Does Django have a better way for my solution?
I used this method. But I don’t know how it is work!
the user attaches to the current session. so what? How can I use this method?

You only need to log in once - that is correct.

For all other views where you need to ensure that the user is currently logged in, you check their current status. For example, you can use the login_required decorator on a view to check to see if a person trying to access a view is currently logged in. If they’re not, you can redirect them to the login page.

See all the docs at Using the Django authentication system | Django documentation | Django