From f3561e7fa0666bf8f7ce510d0e0124c9304293e4 Mon Sep 17 00:00:00 2001 From: wu Date: Sat, 22 Apr 2023 14:46:05 +0800 Subject: [PATCH] Update the env variable file encoding to utf-8 --- backend/app/.env.example | 4 ++-- backend/app/core/conf.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/app/.env.example b/backend/app/.env.example index b1bf8e0d..8522c1d8 100644 --- a/backend/app/.env.example +++ b/backend/app/.env.example @@ -1,10 +1,10 @@ # Env: dev、pro -ENVIRONMENT='pro' +ENVIRONMENT='dev' # MySQL DB_HOST='127.0.0.1' DB_PORT=3306 DB_USER='root' -DB_PASSWORD='' +DB_PASSWORD='123456' # Redis REDIS_HOST='127.0.0.1' REDIS_PORT=6379 diff --git a/backend/app/core/conf.py b/backend/app/core/conf.py index 0da4fc45..a246a7d8 100644 --- a/backend/app/core/conf.py +++ b/backend/app/core/conf.py @@ -93,7 +93,9 @@ class Settings(BaseSettings): MIDDLEWARE_ACCESS: bool = False class Config: - env_file = '.env' + # https://docs.pydantic.dev/usage/settings/#dotenv-env-support + env_file = '.env', '.env.example' + env_file_encoding = 'utf-8' @lru_cache