Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Initializes a :class:`flask.Flask` instance for use with this
extension. Unlike calling :class:`MakeStatic` with an app this will not
bind the extension object to the given `app` so calls to :meth:`watch`
or :meth:`compile` have to be done in an application context::

    make_static = MakeStatic()

    app = Flask(__name__)
    make_static.init_app(app)
    with app.app_context():(more...)

src/f/l/Flask-MakeStatic-0.3.0/test_makestatic.py   Flask-MakeStatic(Download)
            app.config.update(config)
        make_static = MakeStatic()
        make_static.init_app(app)
        with app.app_context():
            watcher = make_static.watch(sleep=0.01)
    def test_compile_in_app_context(self):
        app = Flask('working')
        make_static = MakeStatic()
        make_static.init_app(app)
        with app.app_context():
    def test_compile_factory_pattern_without_app_context(self):
        app = Flask('working')
        make_static = MakeStatic()
        make_static.init_app(app)
        self.assertRaises(RuntimeError, make_static.compile)