Reload changes from config.py #4878
-
Is there any way to reload settings from config.py such as
without restarting app? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can call Remember that under most circumstances, you’ll be running multiple workers/threads and therefore multiple instances of your app. Therefore, updating the config in this way would only affect a single instance. If you have changed your configuration, you should restart all running instances of your app. If you have data that you expect to change while the app is running, you should store it in a database, redis, etc.—somewhere centralized that your app can query whenever it needs that data. |
Beta Was this translation helpful? Give feedback.
You can call
app.config.update()
at any time to update your app's configuration, but you probably shouldn’t.Remember that under most circumstances, you’ll be running multiple workers/threads and therefore multiple instances of your app. Therefore, updating the config in this way would only affect a single instance.
If you have changed your configuration, you should restart all running instances of your app.
If you have data that you expect to change while the app is running, you should store it in a database, redis, etc.—somewhere centralized that your app can query whenever it needs that data.