ARTICLE AD BOX
I'm following this Flask tutorial on YouTube and while doing this part (20:04) I keep running into the following error while his is working perfectly:
db.create_all() Traceback (most recent call last): File "<python-input-22>", line 1, in <module> db.create_all() File "/private/var/mobile/Containers/Data/Application/C947BF90-9845-4F95-8498-5A5D40FE788F/Documents/Flask_files/lib/python3.13/site-packages/flask_sqlalchemy/extension.py", line 900, in create_all self._call_for_binds(bind_key, "create_all") File "/private/var/mobile/Containers/Data/Application/C947BF90-9845-4F95-8498-5A5D40FE788F/Documents/Flask_files/lib/python3.13/site-packages/flask_sqlalchemy/extension.py", line 871, in _call_for_binds engine = self.engines[key] File "/private/var/mobile/Containers/Data/Application/C947BF90-9845-4F95-8498-5A5D40FE788F/Documents/Flask_files/lib/python3.13/site-packages/flask_sqlalchemy/extension.py", line 687, in engines app = current_app._get_current_object() # type: ignore[attr-defined] File "/private/var/mobile/Containers/Data/Application/C947BF90-9845-4F95-8498-5A5D40FE788F/Documents/Flask_files/lib/python3.13/site-packages/werkzeug/local.py", line 519, in _get_current_object raise RuntimeError(unbound_message) from None RuntimeError: Working outside of application context . This typically means that you attempted to use functionality that needed the current application. To solve this, set up an application context with app.app_context(). See the documentation for more information.