Example #1
0
def create_user(name, email, password, organization):
    """Creates a new user without sending email

    The user's account is immediately verified and approved.
    None of the arguments are validated.
    """

    password = bcrypt.generate_password_hash(password, 12)

    app = create_app()
    with app.app_context():
        user = User(name=name, email=email, password=password,
                    email_verified=True, email_verification_token='manage.py',
                    approved=True, approval_token='manage.py')
        if organization:
            user.organization = organization

        db.session.add(user)
        db.session.commit()
Example #2
0
from avresearcher import create_app

app = create_app()
Example #3
0
def init_db():
    """Creates all required database tables"""
    app = create_app()

    with app.app_context():
        db.create_all()
Example #4
0
def runserver(host, port, debug):
    """Start a Flask development server"""
    app = create_app()
    app.run(host=host, port=port, debug=debug, use_reloader=True)