Sets base href from environment variable

This commit is contained in:
Aaron Louie 2020-05-23 12:29:18 -04:00
parent 0fa80ea5fb
commit 4a03fb1ede
3 changed files with 3 additions and 1 deletions

2
app.py
View File

@ -107,7 +107,7 @@ def index():
# display results
studies = db.session.query(Study).order_by(Study.DATE_MODIFIED.desc()).all()
table = StudyTable(studies)
return render_template('index.html', table=table)
return render_template('index.html', table=table, BASE_HREF=app.config['BASE_HREF'])
@app.route('/new_study', methods=['GET', 'POST'])

View File

@ -8,6 +8,7 @@ FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default="5001")
CORS_ENABLED = False
DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true"
TESTING = environ.get('TESTING', default="false") == "true"
BASE_HREF = environ.get('BASE_HREF', default="/")
DB_HOST = environ.get('DB_HOST', default="localhost")
DB_PORT = environ.get('DB_PORT', default="5432")

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<title>Protocol Builder Mock</title>
<base href="{{ BASE_HREF }}">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://use.typekit.net/kwp6dli.css">
{% assets 'app_scss' %}