Update views.py

from django.contrib.auth import get_user_model
User = get_user_model()