How to Solve NameError: name 'Product' is not defined -- .models

Solution: Import the 'Product' module

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

from .models import Product

 

For more information:
Python .models Product