Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload templates without restarting #173

Merged
merged 5 commits into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ class DevelopmentConfig(Config):
SURVEY_PASSWORD = os.getenv('SURVEY_PASSWORD', 'secret')
SURVEY_AUTH = (SURVEY_USERNAME, SURVEY_PASSWORD)

TEMPLATES_AUTO_RELOAD = True
EXPLAIN_TEMPLATE_LOADING = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want EXPLAIN_TEMPLATE_LOADING on by default? It does tend to flood logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point. It can be useful if there are issues around template loading. I'll conduct a straw poll tomorrow and see what people prefer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is TEMPLATES_AUTO_RELOAD needed? See pallets/flask#1907 and pyvec/elsa#44


UAA_SERVICE_URL = os.getenv('UAA_SERVICE_URL', 'http://localhost:9080')
UAA_CLIENT_ID = os.getenv('UAA_CLIENT_ID', 'response_operations')
UAA_CLIENT_SECRET = os.getenv('UAA_CLIENT_SECRET', 'password')
Expand Down
3 changes: 3 additions & 0 deletions response_operations_ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
# wrap in the flask server side session manager and back it by redis
app.config['SESSION_REDIS'] = redis

if app.config['DEBUG']:
app.jinja_env.auto_reload = True

Session(app)


Expand Down