def create(env): "Creates database tables from sqlalchemy models" init_for(env) db.create_all()
def run(self, args): if len(args) and not args[0].startswith('-'): init_for(args[0]) super(InitedMigrations, self).run(args[1:])
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()
#!/usr/bin/env python from hacknight import app, init_for init_for('development') app.run('0.0.0.0', debug=True, port=8100)
def handle(self, *args, **kwargs): if 'env' in kwargs: init_for(kwargs.pop('env')) super(InitedServer, self).handle(*args, **kwargs)
def run(self, args): if len(args) and not args[0].startswith("-"): init_for(args[0]) super(InitedMigrations, self).run(args[1:])
def handle(self, *args, **kwargs): if "env" in kwargs: init_for(kwargs.pop("env")) super(InitedServer, self).handle(*args, **kwargs)
import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) from hacknight import app as application, init_for init_for('production')