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

Solution: Import the 'CharField' module

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

from django.db.models import CharField

 

For more information:
Python django CharField