Browse Source

feat: 添加配置启动程序

SongZihuan 3 years ago
parent
commit
1520c6d987
1 changed files with 10 additions and 1 deletions
  1. 10 1
      main.py

+ 10 - 1
main.py

@@ -1,5 +1,14 @@
 import configure
 import app as App
+import os
+import logging
 
-app = App.HEnglishFlask(__name__)
 
+env_dict = os.environ
+hblog_conf = env_dict.get("HENGLISH_CONF")
+if hblog_conf is not None:
+    logging.info(f"Configure file {hblog_conf}")
+    configure.configure(hblog_conf, encoding="utf-8")
+
+
+app = App.HEnglishFlask(__name__)