I have a Flask
app running with python-socketio
and eventlet
.
if __name__ == '__main__':
import eventlet
import eventlet.wsgi
eventlet.wsgi.server(eventlet.listen(('', 5000)), app)
Every time I change anything in the templates it does not affect the app and I have to restart the app (CTRL+C
and then again python app.py
). How can I disable this "cache" or rather enable template reloading?
You need to enable the debug mode in your app config: app.debug = True
or app.config['DEBUG'] = True
. Just make sure you enable this flag only in development since it can have performance and security implications. You can find more details in Flask documentation.
In my case app.debug = True
did not work, but app.config['TEMPLATES_AUTO_RELOAD'] = True
did, per Disable Template Cache Jinja2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With