Fix config problem with gunicorn

* the `__name__` variable is not `__main__` when the app is opened with gunicorn.
This commit is contained in:
karta0807913
2021-07-21 09:21:47 +08:00
committed by GitHub
parent 633ac1640a
commit c14f49078a

View File

@@ -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():