Ejemplo n.º 1
0


def init_app():

    init_login()

    admin = Admin(app)
    admin.add_view(AdminViews(name='Admin View'))



if __name__ == '__main__':

    init_app()
    db.create_all()

    #Now we create a SUPERUSER in the User table if not created earlier.
    superuser = User.query.filter(User.email == SUPERUSER_USERNAME).scalar()
    if not superuser:
        try:
            entry = User(SUPERUSER_USERNAME,SUPERUSER_PASSWORD,True)
            db.session.add(entry)
            db.session.commit()
        except:
            db.session.rollback()


    app.run()
Ejemplo n.º 2
0
__author__ = 'dimitris'

from Application import app

app.run(debug=True, host='0.0.0.0', port=5050)