How to Solve NameError: name 'MPTTModel' is not defined -- mptt

Erorr: name 'MPTTModel' is not defined

NameError: name 'MPTTModel' is not defined

Solution: name 'MPTTModel' is not defined

# Add the following line to the top of your code
from mptt.models import MPTTModel, TreeForeignKey

 

For more information:
Python MPTTModel