Exemplo n.º 1
0
 def setUp(self):
     init_for('testing')
     app.config['TESTING'] = True
     db.app = app
     db.create_all()
     self.db = db
     make_fixtures()
Exemplo n.º 2
0
def setversion(env):
    '''
    Manually set the alembic version of the
    database to the provided value.
    '''
    init_for(env)
    config = FlaskAlembicConfig("alembic.ini")
    version = raw_input("Enter the alembic version to be set:")
    command.stamp(config, version)
Exemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

from lastuserapp import app, init_for

init_for('dev')
app.run('0.0.0.0', port=7000, debug=True)
Exemplo n.º 4
0
import sys
import os.path
sys.path.insert(0, os.path.dirname(__file__))
from lastuserapp import app as application, init_for
init_for('production')
Exemplo n.º 5
0
def create(env):
    "Creates database tables from sqlalchemy models"
    init_for(env)
    db.create_all()
    config = FlaskAlembicConfig("alembic.ini")
    command.stamp(config, "head")
Exemplo n.º 6
0
def drop(env):
    "Drops database tables"
    init_for(env)
    if prompt_bool("Are you sure you want to lose all your data?"):
        db.drop_all()
Exemplo n.º 7
0
 def run(self, args):
     if len(args) and not args[0].startswith('-'):
         init_for(args[0])
     super(InitedMigrations, self).run(args[1:])
Exemplo n.º 8
0
 def handle(self, *args, **kwargs):
     if 'env' in kwargs:
         init_for(kwargs.pop('env'))
     super(InitedServer, self).handle(*args, **kwargs)