Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get app? #38

Open
dmitrybelyakov opened this issue Nov 8, 2014 · 1 comment
Open

How to get app? #38

dmitrybelyakov opened this issue Nov 8, 2014 · 1 comment

Comments

@dmitrybelyakov
Copy link

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?

@AlexFrazer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants