Remove URL prefix, can be added during deploy, see http://flask.pocoo.org/snippets/35/ or so

This commit is contained in:
Feliciaan De Palmenaer 2015-03-27 01:23:07 +01:00
parent 0426b71556
commit 5da909dce4
3 changed files with 4 additions and 6 deletions

View file

@ -27,7 +27,7 @@ class LocationAdminModel(ModelBaseView):
form_columns = ('name', 'address', 'website') 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(UserAdminModel(User, db.session))
admin.add_view(LocationAdminModel(Location, db.session)) admin.add_view(LocationAdminModel(Location, db.session))

View file

@ -14,12 +14,12 @@ login_manager.init_app(app)
def load_user(userid): def load_user(userid):
return User.query.filter_by(id=userid).first() return User.query.filter_by(id=userid).first()
@app.route('/foodbot/login') @app.route('/login')
def login(): def login():
return zeus_login() return zeus_login()
@app.route('/foodbot/logout') @app.route('/logout')
def logout(): def logout():
if 'zeus_token' in session: if 'zeus_token' in session:
session.pop('zeus_token', None) session.pop('zeus_token', None)

View file

@ -25,11 +25,9 @@ zeus = oauth.remote_app(
def zeus_login(): def zeus_login():
if app.debug: if app.debug:
return zeus.authorize(callback=url_for('authorized', _external=True)) 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(): def authorized():
resp = zeus.authorized_response() resp = zeus.authorized_response()
if resp is None: if resp is None: