From c14f49078a90b13dcf0ebbc64016a6d9ce32fd9e Mon Sep 17 00:00:00 2001 From: karta0807913 Date: Wed, 21 Jul 2021 09:21:47 +0800 Subject: [PATCH] Fix config problem with gunicorn * the `__name__` variable is not `__main__` when the app is opened with gunicorn. --- flash_cards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flash_cards.py b/flash_cards.py index 9d35980..1a8715b 100644 --- a/flash_cards.py +++ b/flash_cards.py @@ -17,7 +17,7 @@ def load_config(): )) app.config.from_envvar('CARDS_SETTINGS', silent=True) -if __name__ == "__main__": +if __name__ == "__main__" or __name__ == "flash_cards": load_config() def connect_db():