Load config from 'config.py'.

This commit is contained in:
Patrick Jentsch 2019-07-03 15:40:45 +02:00
parent f6e7b44863
commit 96fc8f4064
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,14 @@
from config import config
from flask import Flask
def create_app():
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
@app.route('/')
def index():
return 'Opaque'
return app

View File

@ -1,4 +1,5 @@
from app import create_app
import os
app = create_app
app = create_app(os.getenv('FLASK_CONFIG') or 'default')