Flask/project_name/base.py

22 lines
553 B
Python
Raw Normal View History

2024-11-10 07:27:36 -08:00
from dynaconf import FlaskDynaconf
from flask import Flask
def create_app(**config):
app = Flask(__name__)
FlaskDynaconf(app) # config managed by Dynaconf
app.config.load_extensions(
"EXTENSIONS"
) # Load extensions from settings.toml
app.config.update(config) # Override with passed config
return app
def create_app_wsgi():
# workaround for Flask issue
# that doesn't allow **config
# to be passed to create_app
# https://github.com/pallets/flask/issues/4170
app = create_app()
return app