Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

flask how to initialze extension after start

class FooManager:

    def __init__(self, app=None, db=None, **kwargs):
        self.app = app
        if app is not None:
            self.init_app(app, db, **kwargs)

    def init_app(self, app, db, **kwargs):
        self.db = db

        app.config.setdefault('xxx', xxx)

        # Bind Flask-Foo to app
        app.foo_manager = self
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flask #initialze #extension #start
ADD COMMENT
Topic
Name
1+6 =