Airflow webserver terminate because of wrong app context Flask

So I had Airflow’s webserver running fine until I created a Flask app within the same project root.

  -airflow_home/ # airflow dags, config, etc...

here is the airflow-webserver error:

airflow[19435]: app = cached_app_rbac(None) if settings.RBAC else cached_app(None)
airflow[19435]: File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www/", line 204, in cached_app
airflow[19435]: app = create_app(config, testing)
airflow[19435]: File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www/", line 186, in create_app
airflow[19435]: return app
airflow[19435]: File "/home/airflow/.local/lib/python3.7/site-packages/flask/", line 249, in __exit__
airflow[19435]: self.pop(exc_value)
airflow[19435]: File "/home/airflow/.local/lib/python3.7/site-packages/flask/", line 241, in pop
airflow[19435]: assert rv is self, "Popped wrong app context.  (%r instead of %r)" % (rv, self)
airflow[19435]: AssertionError: Popped wrong app context.  (<flask.ctx.AppContext object at 0x7fa117448d10> instead of <flask.ctx.AppContext object at 0x7fa18678f0d0>)


from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import app.config as config

db = SQLAlchemy()

def create_app(config_name):
    app = Flask(__name__)

    return app

from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
import app.config as config

from app import create_app, db

from app import models

app = create_app(config.Config)


manager = Manager(app)

migrate = Migrate(app, db)

manager.add_command('db', MigrateCommand)

def run():

if __name__ == '__main__':