How to Solve NameError: name 'BlogPost' is not defined -- myapp

Solution: Import the 'BlogPost' module

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

from myapp.models import BlogPost

 

For more information:
Python myapp BlogPost