Skip to content

Commit

Permalink
fix app.env
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Oct 7, 2023
1 parent 78f0ac0 commit b5ac9d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Settings(BaseSettings):
# 是否开发模式
DEV: bool = False
# 配置文件目录
CONFIG_DIR: str = None
CONFIG_DIR: str = "/config"
# 超级管理员
SUPERUSER: str = "admin"
# 超级管理员初始密码
Expand Down Expand Up @@ -281,9 +281,10 @@ def __init__(self, **kwargs):
p.mkdir(parents=True, exist_ok=True)

class Config:
env_file = "/config/app.env"
env_file_encoding = "utf-8"
case_sensitive = True


settings = Settings()
settings = Settings(
_env_file=Settings().CONFIG_PATH / "app.env",
_env_file_encoding="utf-8"
)
2 changes: 0 additions & 2 deletions config/app.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ PORT=3001
DEBUG=false
# 是否开发模式
DEV=false
# 配置文件目录
CONFIG_DIR="/config"
# 超级管理员
SUPERUSER="admin"
# 超级管理员初始密码
Expand Down

0 comments on commit b5ac9d4

Please sign in to comment.