- An active Flask application context is always required to access
session
andengine
, regardless of if an application was passed to the constructor. - Without an application context, creating db from terminal will raise
RuntimeError: Working outside of application context.
when you try to invokedb.create_all()
from python interpreter. - To counteract this issue, two solutions are presented:
flask shell
offers made-ready app context and instance to create db.- Import app from FlaskBlog and create db under app context:
from flaskblog import app with app.app_context(): db.create_all()
forked from CoreyMSchafer/code_snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
License
HeyItWorked/code_snippets
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Jupyter Notebook 70.1%
- Python 15.0%
- HTML 13.5%
- CSS 1.4%
- Shell 0.0%
- JavaScript 0.0%