TypeError: login() takes 1 positional argument but 2 were given

Your view has the same name as the auth login function, so it is hiding it. Change the view name, or import the function under a different name eg from django.contrib.auth import login as auth_login.


You can not use same name for your def whom you imported. so change your def name from def login to another one.


You have a function def login and a library import with the same name.

What you need is to change one of them.

Example :

- def user_login  // import login as Login_process