Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

        def create_app(defer_init_app=False, freezer_kwargs=None):
    app = Flask(__name__)
    app.register_blueprint(admin_blueprint, url_prefix='/admin')
    if not freezer_kwargs:
        freezer_kwargs = {}
    if defer_init_app:
        freezer = Freezer(**freezer_kwargs)
    else:
        freezer = Freezer(app, **freezer_kwargs)

    @app.route('/')
    def index():
        return ('Main index ' +
                url_for('product', product_id='5', revision='b12ef20'))

    @app.route('/page//')
    def page(name):
        url_for('product', product_id='3')  # Pretend we’re adding a link
        url_for('product', product_id='4')  # Another link
        return u'Hello\xa0World! ' + name

    @app.route('/where_am_i/')
    def where_am_i():
        return (url_for('where_am_i') + ' ' +
                url_for('where_am_i', _external=True))

    @app.route('/robots.txt')
    def robots_txt():
        content = 'User-agent: *\nDisallow: /'
        return app.response_class(content, mimetype='text/plain')

    for asset in ("favicon.ico",):
        url = "/" + asset
        name = asset.replace(".", "_")
        app.add_url_rule(url, name, partial(app.send_static_file, filename=asset))

    @app.route('/product_/')
    def product(product_id):
        return 'Product num %i' % product_id

    @app.route('/add/', methods=['POST'])
    def add_something(product_id):
        return 'This view should be ignored as it does not accept GET.'

    @freezer.register_generator
    def product():
        # endpoint, values
        yield 'product', {'product_id': 0}
        yield 'page', {'name': 'foo'}
        # Just a `values` dict. The endpoint defaults to the name of the
        # generator function, just like with Flask views
        yield {'product_id': 1}
        # single string: url
        yield '/product_2/'

    if defer_init_app:
        freezer.init_app(app)

    return app, freezer
        


src/f/r/Frozen-Flask-0.11/flask_frozen/tests.py   Frozen-Flask(Download)
    def make_app(self):
        with temp_directory() as temp:
            app, freezer = test_app.create_app(self.defer_init_app,
                                               self.freezer_kwargs)
            app.config['FREEZER_DESTINATION'] = temp
    def test_all_urls_method(self):
        app, freezer = test_app.create_app(freezer_kwargs=self.freezer_kwargs)
        expected = sorted(self.expected_output)
        # url_for() calls are not logged when just calling .all_urls()
        for url in self.generated_by_url_for:

src/f/r/Frozen-Flask-HEAD/flask_frozen/tests.py   Frozen-Flask(Download)
    def make_app(self):
        with temp_directory() as temp:
            app, freezer = test_app.create_app(self.defer_init_app,
                                               self.freezer_kwargs)
            app.config['FREEZER_DESTINATION'] = temp