fbone icon indicating copy to clipboard operation
fbone copied to clipboard

How to get app?

Open dmitrybelyakov opened this issue 10 years ago • 1 comments

Hey!

Thanks for great layout it is really helpful! However I have one simple question - how to I actually access the app? It is created in manage.py and is not exported anywhere so when I need it somewhere, say in my models when I need app.config how do I get it?

dmitrybelyakov avatar Nov 08 '14 10:11 dmitrybelyakov

do you mean accessing the current app in a module?

from flask import current_app as app
print(app.config)

this is part of flask http://flask.pocoo.org/docs/0.10/api/#useful-functions-and-classes

AlexFrazer avatar Nov 08 '14 17:11 AlexFrazer