diff options
author | Alexander_Kabui | 2024-09-13 15:46:27 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-13 15:46:27 +0300 |
commit | 954993cca85a90a1d2868a9852b685824686952e (patch) | |
tree | c52ac18ce7460c832ec97880e7f326be53784c68 | |
parent | 904957b017179d530c60f4b231a26cc2b8747987 (diff) | |
download | genenetwork2-954993cca85a90a1d2868a9852b685824686952e.tar.gz |
Define new blueprint for all gn_docs.
-rw-r--r-- | gn2/wqflask/__init__.py | 2 | ||||
-rw-r--r-- | gn2/wqflask/api/markdown.py | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gn2/wqflask/__init__.py b/gn2/wqflask/__init__.py index 00fe5127..d959598d 100644 --- a/gn2/wqflask/__init__.py +++ b/gn2/wqflask/__init__.py @@ -34,6 +34,7 @@ from gn2.wqflask.api.markdown import facilities_blueprint from gn2.wqflask.api.markdown import blogs_blueprint from gn2.wqflask.api.markdown import news_blueprint from gn2.wqflask.api.markdown import xapian_syntax_blueprint +from gn2.wqflask.api.markdown import gn_docs_blueprint from gn2.wqflask.api.jobs import jobs as jobs_bp from gn2.wqflask.oauth2.routes import oauth2 from gn2.wqflask.oauth2.client import user_logged_in @@ -109,6 +110,7 @@ app.jinja_env.globals.update( # Registering blueprints +app.register_blueprint(gn_docs_blueprint, url_prefix="/gn_docs") app.register_blueprint(glossary_blueprint, url_prefix="/glossary") app.register_blueprint(references_blueprint, url_prefix="/references") app.register_blueprint(links_blueprint, url_prefix="/links") diff --git a/gn2/wqflask/api/markdown.py b/gn2/wqflask/api/markdown.py index f0f94b52..9a43ecdb 100644 --- a/gn2/wqflask/api/markdown.py +++ b/gn2/wqflask/api/markdown.py @@ -29,6 +29,7 @@ news_blueprint = Blueprint("news_blueprint", __name__) xapian_syntax_blueprint = Blueprint("xapian_syntax_blueprint", __name__) blogs_blueprint = Blueprint("blogs_blueprint", __name__) +gn_docs_blueprint = Blueprint("gn_docs_blueprint", __name__) def fetch_raw_markdown(file_path): @@ -243,3 +244,12 @@ def blogs_list(): blogs = get_blogs() return render_template("blogs_list.html", blogs=blogs) + + +@gn_docs_blueprint.errorhandler(requests.exceptions.HTTPError) +def page_not_found(error): + """ Return error 404 """ + return {"Reason": error.response.reason, + "error_status_code": error.response.status_code, + "error_msg": error.response.text + } |