def _init_app(): from app.ivysaur_app import create_app ivysaur_env = os.environ.get('IVYSAUR_ENV') if not ivysaur_env: print "please set IVYSAUR_ENV environment var" sys.exit(1) create_app(ivysaur_env)
def create_test_environment(): app = create_app('test') Manager(app) db = get_registry()['DB'] Migrate(app, db) with app.app_context(): upgrade() set_app(app) return app
import os import sys import arrow from app.ivysaur_app import create_app from flask.ext.script import Manager from flask.ext.migrate import Migrate, MigrateCommand from lib.registry import get_registry ivysaur_env = os.environ.get('IVYSAUR_ENV') if not ivysaur_env: print "please set IVYSAUR_ENV environment var" sys.exit(1) app = create_app(ivysaur_env) db = get_registry()['DB'] from lib.models.role import Role # NOQA from lib.models.user import User # NOQA from lib.models.device import Device # NOQA from lib.models.base_folder import BaseFolder # NOQA from lib.models.base_deck import BaseDeck # NOQA from lib.models.base_set import BaseSet # NOQA from lib.models.base_card import BaseCard # NOQA from lib.models.base_card_content import BaseCardContent # NOQA from lib.models.card import Card # NOQA from lib.models.card_likes import CardLikes # NOQA from lib.models.card_comments import CardComments # NOQA from lib.models.notification import Notification # NOQA from lib.models.confirmation_email import ConfirmationEmail # NOQA
#!/usr/bin/env python import os import sys from app.ivysaur_app import create_app ivysaur_env = os.environ.get('IVYSAUR_ENV') if not ivysaur_env: print "please set IVYSAUR_ENV environment var" sys.exit(1) application = create_app(ivysaur_env) if __name__ == '__main__': if ivysaur_env == 'development': application.run(host='0.0.0.0', threaded=True) # application.run(threaded=True) else: application.run()