How to Solve NameError: name 'relationship' is not defined -- sqlalchemy
Solution: Import the 'relationship' module
# Add the following line to the top of your code
from sqlalchemy.orm import relationship
For more information:
sqlalchemy relationship