Python-API-Development-Fundamentals
Python-API-Development-Fundamentals copied to clipboard
Update script.txt
If you don't update the context inside the app, db.session.add(user) will fail with error:
RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.