aboutsummaryrefslogtreecommitdiffstats
path: root/edaweb/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'edaweb/app.py')
-rw-r--r--edaweb/app.py4
1 files changed, 2 insertions, 2 deletions
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: