FlaskFm - Project - RuntimeError: Working outside of application context

When initializing the database I get this error:

app = current_app._get_current_object() # type: ignore[attr-defined]
File “C:\Users\Usuario\Documents\Flask\venv\lib\site-packages\werkzeug\local.py”, line 513, 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.