from appl import create_app from appl.configs.production import ProductionConfig application = create_app(config=ProductionConfig())
from appl import create_app app = create_app('default') if __name__ == '__main__': app.run() # app.run(host='0.0.0.0')
sys.path.append(os.getcwd()) # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. fileConfig(config.config_file_name) # add your model's MetaData object here # for 'autogenerate' support from appl import create_app from appl.configs.development import DevelopmentConfig app = create_app(DevelopmentConfig) from appl.utils.db_base import Base target_metadata = Base.metadata # other values from the config, defined by the needs of env.py, # can be acquired: # my_important_option = config.get_main_option("my_important_option") # ... etc. 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
# -*- coding: utf-8 -*- from flask.ext.script import Manager, Server from appl import create_app from appl.config.development import DevelopmentConfig app = create_app(config=DevelopmentConfig) manager = Manager(app) # ** The Flask-Script will override app.config['DEBUG'] _USE_DEBUGGER = app.debug # Run local server manager.add_command("runserver", Server(host='localhost', port=5000, use_debugger=_USE_DEBUGGER)) if __name__ == "__main__": manager.run()
from appl import create_app from flask import render_template app = create_app() if __name__ == '__main__': app.run(debug=True)
sys.path.append(os.getcwd()) # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. fileConfig(config.config_file_name) # add your model's MetaData object here # for 'autogenerate' support from appl import create_app from appl.configs.development import DevelopmentConfig app = create_app(DevelopmentConfig) from appl.utils.db_base import Base target_metadata = Base.metadata # other values from the config, defined by the needs of env.py, # can be acquired: # my_important_option = config.get_main_option("my_important_option") # ... etc. 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
from appl import create_app import os application = create_app() if __name__ == "__main__": ENVIRONMENT_DEBUG = os.environ.get("APP_DEBUG", True) ENVIRONMENT_PORT = os.environ.get("APP_PORT", 5000) application.run(host='0.0.0.0', debug=ENVIRONMENT_DEBUG, port=ENVIRONMENT_PORT)