From 2159e47e287920c1a89188ba789329344e952034 Mon Sep 17 00:00:00 2001 From: jwansek Date: Tue, 29 Apr 2025 20:28:44 +0100 Subject: Various bug fixes --- edaweb/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'edaweb/app.py') diff --git a/edaweb/app.py b/edaweb/app.py index 6902fe4..436df7a 100644 --- a/edaweb/app.py +++ b/edaweb/app.py @@ -17,7 +17,7 @@ import io app = flask.Flask(__name__) CONFIG = configparser.ConfigParser(interpolation = None) -CONFIG.read("edaweb.conf") +CONFIG.read(os.path.join(os.path.dirname(__file__), "edaweb.conf")) shown_images = set() shown_sidebar_images = set() @@ -224,7 +224,7 @@ def serve_random(): sbi = services.get_random_image(tags) req = urllib.request.Request(sbi.imurl) mediaContent = urllib.request.urlopen(req).read() - with open(os.path.join("static", "images", "random.jpg"), "wb") as f: + with open(os.path.join(os.path.dirname(__file__), "static", "images", "random.jpg"), "wb") as f: f.write(mediaContent) with database.Database() as db: -- cgit v1.2.3