Exemple #1
0
    @login_manager.user_loader
    def load_user(user_id):
        return User.get(user_id)


# Flask views
@app.route('/')
def index():
    return render_template("sb-admin/redirect.html")


@app.route('/student/')
def student():
    return render_template("sb-admin/student.html")


@app.errorhandler(404)
def fourOhFour(error):
    return '404: You have wandered too far young adventurer!'


# Initialize flask-login
init_login()

# Create admin
admin = admin.Admin(app, 'ExamIT v0.8', index_view=AdminIndexView())
# admin.add_view(BlankView(name='Blank', url='blank', endpoint='blank'))

if __name__ == '__main__':
    app.run(debug=True, port=5050)
Exemple #2
0
        logging.info("App deactivated")
    else:
        logging.warning(
            "Something went wrong deactivating the app. Status code :" +
            str(r.status_code))

    data_handler.update_apps()


@socketio.on('my_ping', namespace='')
def ping_pong():
    emit('my_pong')


@socketio.on('disconnect', namespace='')
def test_disconnect():
    print('Client disconnected', request.sid)


# Initialize flask-login
init_login()

# Create admin
admin = admin.Admin(app,
                    'TENNISON Operator Interface',
                    index_view=AdminIndexView())
#admin.add_view(BlankView(name='Blank', url='blank', endpoint='blank'))

if __name__ == '__main__':
    socketio.run(app, debug=True, use_reloader=False, host='0.0.0.0')
Exemple #3
0
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'


# Initialize flask-login
def init_login():
    login_manager = login.LoginManager()
    login_manager.init_app(app)

    # Create user loader function
    @login_manager.user_loader
    def load_user(user_id):
        return User.get(user_id)


# Flask views
@app.route('/')
def index():
    return render_template("sb-admin/redirect.html")


# Initialize flask-login
init_login()

# Create admin
admin = admin.Admin(app, 'SB-Admin-2', index_view=AdminIndexView())
#admin.add_view(BlankView(name='Blank', url='blank', endpoint='blank'))

if __name__ == '__main__':
    app.run(debug=True)
Exemple #4
0
def init_login():
    login_manager = login.LoginManager()
    login_manager.init_app(app)

    # Create user loader function
    @login_manager.user_loader
    def load_user(user_id):
        return User.query.get(user_id)


init_login()

admin = admin.Admin(app,
                    'aBay',
                    index_view=AdminIndexView(url='/killerapp'),
                    template_mode="bootstrap3")

admin.add_view(ActiveView(ActiveItem, db_session, endpoint="active"))
admin.add_view(EndedView(ActiveItem, db_session, endpoint="ended"))
admin.add_view(OrderView(OrderItem, db_session, endpoint="orders"))
admin.add_view(ReceiptView(SoldReceipt, db_session, endpoint="receipts"))
admin.add_view(LineItemView(LineItem, db_session, endpoint="lineitem"))
admin.add_view(ScraperView(db_session, endpoint="scraper"))
admin.add_view(TemplateView(db_session, endpoint="template"))
admin.add_view(BlackListView(db_session, endpoint="blacklist"))
admin.add_view(UserView(db_session, endpoint="users"))
admin.add_view(eBayAccountView(db_session, endpoint="ebayacc"))
admin.add_view(NotifyEmailView(db_session, endpoint="notifyemail"))

# Create Flask application
app = Flask(__name__)

# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'

# Initialize flask-login
def init_login():
    login_manager = login.LoginManager()
    login_manager.init_app(app)

    # Create user loader function
    @login_manager.user_loader
    def load_user(user_id):
        return User.get(user_id)

# Flask views
@app.route('/')
def index():
    return render_template('index.html')


# Initialize flask-login
init_login()

# Create admin
admin = admin.Admin(app, 'Example: Auth UserMixin', index_view=AdminIndexView(), base_template='my_master.html')

if __name__ == '__main__':
    app.run(debug=True)
Exemple #6
0
app.config['SECRET_KEY'] = 'ajsdlkjqwoiejoikajs9789812dlkjoiqw1'


# Initialize flask-login
def init_login():
    login_manager = login.LoginManager()
    login_manager.init_app(app)

    # Create user loader function
    @login_manager.user_loader
    def load_user(user_id):
        return User.get(user_id)


# Flask views
@app.route('/')
def index():
    return render_template("sb-admin/redirect.html")


# Initialize flask-login
init_login()

# Create admin
admin = admin.Admin(app, 'Belluminar', index_view=AdminIndexView())
#admin.add_view(BlankView(name='Blank', url='blank', endpoint='blank'))

if __name__ == '__main__':
    print 'Starting'
    app.run(host='0.0.0.0')