Probably fixed problem with finding the root of flask up (gotta change gunicorn settings)

This commit is contained in:
Sergiusz Warga 2020-12-23 23:51:30 +01:00
parent f35f7f4335
commit fb1497f670
2 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,6 @@
from flask import Flask from flask import Flask
app = Flask(__name__) app = Flask(__name__)
app.config["SECRET_KEY"] = "asdasfgrwee" print(app.template_folder)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///latin.sqlite"
from app import routes from app import routes

View File

@ -26,6 +26,6 @@ def llpsi():
@app.route('/llpsi/<path:pensum_id>') @app.route('/llpsi/<path:pensum_id>')
def pensum(pensum_id): 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: with open(filename, 'r') as file:
return render_template('Pensum_cloze.html', pensum_title=pensum_id.replace('_', ' '), pensum_content=file.read()) return render_template('Pensum_cloze.html', pensum_title=pensum_id.replace('_', ' '), pensum_content=file.read())