How to Solve NameError: name 'HttpRequest' is not defined -- django
Solution: Import the 'HttpRequest' module
# Add the following line to the top of your code
from django.http import HttpRequest
For more information:
django HttpRequest