Python - How to import 'TreeForeignKey' -- mptt

Import MPTTModel, TreeForeignKey

To import MPTTModel, TreeForeignKey, Add the following line to the top of your code.

from mptt.models import MPTTModel, TreeForeignKey

 

For more information about MPTTModel, TreeForeignKey:
Python TreeForeignKey