How to use the summer.config.config function in summer

To help you get started, we’ve selected a few summer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaowhen / summer / summer / app.py View on Github external
def create_app(config_name):
    app = Flask(__name__)

    app.config.from_object(config[config_name])

    MakoTemplates(app)

    for blueprint_qualname in blueprints:
        blueprint = import_string(blueprint_qualname)
        app.register_blueprint(blueprint)

    @app.before_request
    def before_request():
        # g.debug = True
        g.debug = app.config['DEBUG']

    @app.teardown_appcontext
    def teardown_db(exception):
        db = getattr(g, '_database', None)
        if db is not None: