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

Possibility to call init_app #22

Open
denisdubovitskiy opened this issue Sep 25, 2018 · 2 comments
Open

Possibility to call init_app #22

denisdubovitskiy opened this issue Sep 25, 2018 · 2 comments
Assignees

Comments

@denisdubovitskiy
Copy link

denisdubovitskiy commented Sep 25, 2018

Seems like the plugin does not support deferred app initialization like other plugins do.

To avoid any cyclic imports in the app it would be great to have init_app method which takes an app as a parameter. Sometimes it's not that easy to initialize a tracer with modular layout.
The documentation has no mention about the usage with flask app factory pattern.

Example

plugins.py

tracer = FlaskTracer()

app.py

from plugins import tracer

def create_app():
    app = Flask()
    tracer.init_app(app)
    return app
@carlosalberto
Copy link
Contributor

Hey @pydrive

Thanks for the info. I will work on this item before we do the eventual release of the 1.0 version (already in the works ;) )

@carlosalberto carlosalberto self-assigned this Sep 25, 2018
@denisdubovitskiy
Copy link
Author

Thanks for the response, @carlosalberto. I'll watch for changes in the thread!

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