def setUp(self):
     self.app = create_app('testing')
     self.app_context = self.app.app_context()
     self.app_context.push()
     db.create_all()
     Role.insert_roles()
     User.add_admin()
     User.add_test_user()
     User.add_admin_dialogue(1)
     User.add_self_follows()
Beispiel #2
0
def deploy():
    """Run deployment task"""
    if not os.path.isfile(app.config['SQLALCHEMY_DATABASE_URI'][10:]):
        db.create_all()
        print 'Datebase created.'
        Role.insert_roles()
        User.add_self_follows()
        User.add_admin()
        User.add_test_user()
        print 'add admin :'\
            '\[email protected]'\
            '\npassword=1234'
        Category.add_none()
        print 'Category insert None.'
    else:
        print 'database already exists!'
    admin_id = input('admin_id:')
    while True:
        if User.query.get(admin_id):
            User.add_admin_dialogue(admin_id)
            break
        else:
            admin_id = input('get admin error!\nadmin_id:')
        print 'User config.'