pyvec / elsa

Helper module for hosting Frozen-Flask based websites on GitHub pages
Other
28 stars 49 forks source link

Serve should watch for changes and autorestart #8

Closed honzajavorek closed 7 years ago

honzajavorek commented 7 years ago

It's really poor developer experience to have to restart it manually.

encukou commented 7 years ago

You need to set app.config['TEMPLATES_AUTO_RELOAD'] = True, as in any Flask app.

The problem is that you need to set it before the Jinja environment is created, and helpers like @app.template_filter create the env.

Elsa does (try to) set the config variable. But by the time Elsa has a chance run, it may be too late for it to have any effect.

encukou commented 7 years ago

Don't know how to fix this properly. Perhaps making people use from elsa import make_app instead of from flask import Flask? (cc @hroncok)

encukou commented 7 years ago

This is reported in Flask: https://github.com/pallets/flask/issues/1907