-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #173 +/- ##
==========================================
- Coverage 96.26% 96.21% -0.06%
==========================================
Files 36 36
Lines 1768 1770 +2
==========================================
+ Hits 1702 1703 +1
- Misses 66 67 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it and it looks all good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected. Not sure if explain is needed though.
config.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@@ -7,7 +7,7 @@ url = "https://pypi.python.org/simple" | |||
python_version = "3.6" | |||
|
|||
[packages] | |||
Flask = "==0.12.2" | |||
Flask = "==0.12" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Motivation and Context
Autoreloads templates when running debug mode. Developers will see changes to html templates without having to restart a running server.
What has changed
Added new config to config.py to set auto reloading to true and to enable more verbose output of template loading information.
How to test?