Ejemplo n.º 1
0
from eventmanager import create_app

app = create_app()
Ejemplo n.º 2
0
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from config import config
from env import env
from eventmanager import create_app, db
from eventmanager.models import User, Center, Event, Facility, Role

app = create_app(env['ENV'] or 'development')
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)


@manager.command
def seed_test_user():
    with app.app_context():
        user = User(first_name='Seun', last_name='Agbeye', email=env['EMAIL'],\
        password='******')
        user.hash_password()
        db.session.add(user)
        db.session.commit()


if __name__ == '__main__':
    manager.run()
Ejemplo n.º 3
0
def app():
    """Create and configure a new app instance for each test."""
    app = create_app()
    yield app