diff options
author | B. Stack <bgstack15@gmail.com> | 2023-08-31 10:23:18 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-08-31 10:27:20 -0400 |
commit | 06ffd01869b4571da57ec1d85c88d0e92d0c6360 (patch) | |
tree | 6196fe75e55bfc85275ec71b8954194738665222 | |
parent | use prefix() in all templates that need it (diff) | |
download | newspipe-06ffd01869b4571da57ec1d85c88d0e92d0c6360.tar.gz newspipe-06ffd01869b4571da57ec1d85c88d0e92d0c6360.tar.bz2 newspipe-06ffd01869b4571da57ec1d85c88d0e92d0c6360.zip |
clean up
-rw-r--r-- | newspipe/bootstrap.py | 12 | ||||
-rw-r--r-- | newspipe/lib/utils.py | 1 |
2 files changed, 3 insertions, 10 deletions
diff --git a/newspipe/bootstrap.py b/newspipe/bootstrap.py index 3ca573b1..1c5c967d 100644 --- a/newspipe/bootstrap.py +++ b/newspipe/bootstrap.py @@ -5,7 +5,6 @@ import os from flask import Flask from flask import request -from flask import url_for as f_url_for from flask_babel import Babel from flask_babel import format_datetime from flask_migrate import Migrate @@ -74,8 +73,8 @@ set_logging(application.config["LOG_PATH"]) _prefix = "" if "PREFIX" in application.config: - application.wsgi_app = ReverseProxied(application.wsgi_app, script_name=application.config["PREFIX"]) - _prefix = application.config["PREFIX"] + application.wsgi_app = ReverseProxied(application.wsgi_app, script_name=application.config["PREFIX"]) + _prefix = application.config["PREFIX"] db = SQLAlchemy(application) @@ -117,13 +116,6 @@ application.jinja_env.globals["application"] = application @application.context_processor def utility_processor(): - #def url_for(endpoint, **values): - # """ Custom reverse-proxy support for url_for """ - # _uf = f_url_for(endpoint, **values) - # #if prefix: - # # _uf = str(prefix) + _uf - # print(f"DEBUG: generating url_for {endpoint}, of {_uf}") - # return _uf def prefix(): return _prefix.rstrip("/") return dict(prefix=prefix) diff --git a/newspipe/lib/utils.py b/newspipe/lib/utils.py index 7e8e4a15..e839d99c 100644 --- a/newspipe/lib/utils.py +++ b/newspipe/lib/utils.py @@ -6,6 +6,7 @@ from hashlib import md5 import requests from flask import request +from flask import url_for from newspipe.bootstrap import application |