How to Solve NameError: name 'Markup' is not defined -- markupsafe

Erorr: name 'Markup' is not defined

NameError: name 'Markup' is not defined

Solution: Import the 'Markup' module

# Add the following line to the top of your code
from markupsafe import Markup

 

For more information:
markupsafe Markup