From 5da909dce46dc3c235f361d5616c0e7f9fae16de Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Fri, 27 Mar 2015 01:23:07 +0100 Subject: [PATCH] Remove URL prefix, can be added during deploy, see http://flask.pocoo.org/snippets/35/ or so --- app/admin.py | 2 +- app/login.py | 4 ++-- app/zeus.py | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/admin.py b/app/admin.py index 96d6039..3fda49c 100644 --- a/app/admin.py +++ b/app/admin.py @@ -27,7 +27,7 @@ class LocationAdminModel(ModelBaseView): form_columns = ('name', 'address', 'website') -admin = Admin(app, name='FoodBot', url='/foodbot/admin', template_mode='bootstrap3') +admin = Admin(app, name='FoodBot', url='/admin', template_mode='bootstrap3') admin.add_view(UserAdminModel(User, db.session)) admin.add_view(LocationAdminModel(Location, db.session)) diff --git a/app/login.py b/app/login.py index 12aff9f..6375128 100644 --- a/app/login.py +++ b/app/login.py @@ -14,12 +14,12 @@ login_manager.init_app(app) def load_user(userid): return User.query.filter_by(id=userid).first() -@app.route('/foodbot/login') +@app.route('/login') def login(): return zeus_login() -@app.route('/foodbot/logout') +@app.route('/logout') def logout(): if 'zeus_token' in session: session.pop('zeus_token', None) diff --git a/app/zeus.py b/app/zeus.py index b3a0c1b..7661260 100644 --- a/app/zeus.py +++ b/app/zeus.py @@ -25,11 +25,9 @@ zeus = oauth.remote_app( def zeus_login(): if app.debug: return zeus.authorize(callback=url_for('authorized', _external=True)) - else: # temporary solution because it otherwise gives trouble on the pi because of proxies and such - return zeus.authorize(callback='http://zeus.ugent.be/foodbot/login/zeus/authorized') -@app.route('/foodbot/login/zeus/authorized') +@app.route('/login/zeus/authorized') def authorized(): resp = zeus.authorized_response() if resp is None: