<gh_stars>0
# -*- coding: utf-8 -*-

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

# config import

from config import app_config, app_active

config = app_config[app_active]


def create_app(config_name: str):

    app = Flask(__name__, template_folder='templates')


    app.secret_key = config.SECRET

    app.config.from_object(app_config[config_name])

    app.config.from_pyfile('config.py')

    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

    db = SQLAlchemy(config.APP)
    

    @app.route('/')
    def index() -> str:
        return 'Hello World!'

    return app