Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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: