From dd7339e199999c43263c2d36475b0798d6e0907d Mon Sep 17 00:00:00 2001 From: Javier Gonzalez Date: Tue, 19 Jul 2022 10:26:51 -0400 Subject: [PATCH] move index from kadi blueprint to top-level, and moved kadi entrypoint to /kadi --- kadi_apps/app.py | 11 ++++++++++- kadi_apps/blueprints/kadi/kadi.py | 8 -------- kadi_apps/templates/base.html | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/kadi_apps/app.py b/kadi_apps/app.py index eaff565..763f027 100755 --- a/kadi_apps/app.py +++ b/kadi_apps/app.py @@ -23,6 +23,13 @@ def internal_error(e): return render_template('500.html'), 500 +def index(): + """Return main page""" + return render_template( + 'index.html', + ) + + def get_app(name=__name__, settings='devel'): import kadi_apps from kadi_apps.blueprints import auth, test, ska_api as api, kadi, find_attitude @@ -53,7 +60,9 @@ def get_app(name=__name__, settings='devel'): app.register_error_handler(404, page_not_found) app.register_error_handler(500, internal_error) - app.register_blueprint(kadi.blueprint, url_prefix='/') + app.add_url_rule("/", view_func=index) + + app.register_blueprint(kadi.blueprint, url_prefix='/kadi') app.register_blueprint(find_attitude.blueprint, url_prefix='/find_attitude') app.register_blueprint(mica.blueprint, url_prefix='/mica') app.register_blueprint(star_hist.blueprint, url_prefix='/star_hist') diff --git a/kadi_apps/blueprints/kadi/kadi.py b/kadi_apps/blueprints/kadi/kadi.py index af63fd2..cbd9a59 100644 --- a/kadi_apps/blueprints/kadi/kadi.py +++ b/kadi_apps/blueprints/kadi/kadi.py @@ -64,14 +64,6 @@ def filter_events( return queryset -@blueprint.route("/") -def index(): - """Return help page for web-kadi API access""" - return render_template( - 'index.html', - ) - - @blueprint.route("/events/") def events(): """Return help page for web-kadi API access""" diff --git a/kadi_apps/templates/base.html b/kadi_apps/templates/base.html index 7432fdd..651f767 100644 --- a/kadi_apps/templates/base.html +++ b/kadi_apps/templates/base.html @@ -24,7 +24,7 @@ {% block titlebar %}