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

Solution: Import the 'LoginRequiredMixin' module

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

from django.contrib.auth.mixins import LoginRequiredMixin

 

For more information:
Python django LoginRequiredMixin