From fb1497f670e475ca9cc9d3871582c60ab72668ac Mon Sep 17 00:00:00 2001 From: Sergiusz Warga Date: Wed, 23 Dec 2020 23:51:30 +0100 Subject: [PATCH] Probably fixed problem with finding the root of flask up (gotta change gunicorn settings) --- app/__init__.py | 3 +-- app/routes.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index de12fb5..cf9e256 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,7 +1,6 @@ from flask import Flask app = Flask(__name__) -app.config["SECRET_KEY"] = "asdasfgrwee" -app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///latin.sqlite" +print(app.template_folder) from app import routes \ No newline at end of file diff --git a/app/routes.py b/app/routes.py index d4bd2f8..49799b8 100644 --- a/app/routes.py +++ b/app/routes.py @@ -26,6 +26,6 @@ def llpsi(): @app.route('/llpsi/') def pensum(pensum_id): - filename = 'templates/Pensa/' + pensum_id + '.html' + filename = app.root_path + '/templates/Pensa/' + pensum_id + '.html' with open(filename, 'r') as file: return render_template('Pensum_cloze.html', pensum_title=pensum_id.replace('_', ' '), pensum_content=file.read())