django-environ

从特定路径加载 .env 文件

  1. # Take environment variables from .env file
  2. environ.Env.read_env(BASE_DIR / '.env') # 这个路径是项目的根目录