How to Solve NameError: name 'json' is not defined -- flask

Solution: Import the 'json' module

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

from flask import json

 

For more information:
Python flask json