There is a problem with your code.
you have a class with
class login(View)), also you have imported
from django.contrib.auth import login
These two have a conflict with each other, change your class name to
L) or something else to not override the