from __future__ import with_statement import sys from os.path import dirname, abspath sys.path.append(dirname(dirname(abspath(__file__)))) from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig from overholt.models import * from overholt.core import db from overholt.api import create_app app = create_app() # 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) # 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():
def _create_app(self): return create_app(settings, register_security_blueprint=True)
# -*- coding: utf-8 -*- """ manage ~~~~~~ Manager module """ from flask.ext.script import Manager from overholt.api import create_app from overholt.manage import ( CreateUserCommand, DeleteUserCommand, ListUsersCommand, CreateRoleCommand, DeleteRoleCommand, ListRolesCommand) manager = Manager(create_app()) manager.add_command('create_user', CreateUserCommand()) manager.add_command('delete_user', DeleteUserCommand()) manager.add_command('list_users', ListUsersCommand()) manager.add_command('create_role', CreateRoleCommand()) manager.add_command('delete_role', DeleteRoleCommand()) manager.add_command('list_roles', ListRolesCommand()) if __name__ == "__main__": manager.run()
# -*- coding: utf-8 -*- from werkzeug.serving import run_simple from werkzeug.wsgi import DispatcherMiddleware from overholt import api, frontend application = DispatcherMiddleware(frontend.create_app(), {'/api': api.create_app()}) if __name__ == "__main__": run_simple('0.0.0.0', 5000, application, use_reloader=True, use_debugger=True)
# -*- coding: utf-8 -*- from werkzeug.serving import run_simple from werkzeug.wsgi import DispatcherMiddleware from overholt import api, frontend application = DispatcherMiddleware(frontend.create_app(), { '/api': api.create_app() }) if __name__ == "__main__": run_simple('0.0.0.0', 5000, application, use_reloader=True, use_debugger=True)
# -*- coding: utf-8 -*- """ manage ~~~~~~ Manager module """ from flask_script import Manager from overholt.api import create_app from overholt.manage import CreateUserCommand, DeleteUserCommand, ListUsersCommand manager = Manager(create_app()) manager.add_command('create_user', CreateUserCommand()) manager.add_command('delete_user', DeleteUserCommand()) manager.add_command('list_users', ListUsersCommand()) if __name__ == "__main__": manager.run()