I know the way to access the flask app obj is using current_app
, however, everytime I run that code I get this error: NameError: global name 'current_app' is not defined
What am I doing wrong here?
My folder structure is this:
/project
gateway.py
settings.py
/app
views.py
models.py
I can't access the app object neither from views.py or models.py :S Always get the same error.
The views.py file declares a blueprint wich is registered in the gateway.py file.
I'm using current_app
inside a view function inside the views.py file.
Hope you can help me.
from flask import current_app
inside those files? – Audrius Kažukauskas