Пример #1
0
def deploy():
    """Run deployment tasks."""
    from flask.ext.migrate import upgrade
    from app.models import GroupRole, User

    # migrate database to latest revision
    upgrade()

    # create user roles
    GroupRole.insert_roles()

    # create self-follows for all users
    User.feed_to_self()
Пример #2
0
def init_dev():
    """Initialize database, migrate, upgrade, and perform initial inserts."""
    from flask.ext.migrate import upgrade, init, migrate
    from app.models import GroupRole, Role, User

    init()
    migrate()
    upgrade()

    # create user roles
    GroupRole.insert_roles()
    Role.insert_roles()

    u = User(username='******', email='*****@*****.**', confirmed=True)
    u.password = '******'
    db.session.add(u)