far. We instantiate out application using our factory passing in the desired environement pulled from the alembic config section. This is specified on the command line using the -n NAME flag. This allows us to neatly tie all of out database configuration state into one object. As the pattern defined in this template is to pull all your models into your views the application factory will ensure all the modls are picked up by alembic Thus ensuring that autogenerate will find any changes you have made for you. """ from worldofsfx import create_app, db FLASK_ENV = config.get_section(config.config_ini_section).get('flask_env', 'DEVELOPMENT') app = create_app(default_env=FLASK_ENV) target_metadata = db.metadata def run_migrations_offline(): """Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available. Calls to context.execute() here emit the given string to the script output. """
from worldofsfx import create_app app = create_app() if __name__ == "__main__": app.run(host=app.config['HOST'], port=app.config['PORT'])