How to Solve NameError: name 'ModelBackend' is not defined -- django

Solution: Import the 'ModelBackend' module

To Solve the error, add the following line to the top of your code.

from django.contrib.auth.backends import ModelBackend

 

For more information:
Python django ModelBackend