from django.contrib.auth.models import authenticate code example Example: from django.contrib.auth.decorators import authenticate, login from django.contrib.auth import authenticate, login