boot.config module

Provides a uniform way to read settings from config.json.

假设要在名为 app_name 的 app 下加入新的设置,可按以下步骤: 1. 在 config.json 中添加相应设置 2. 在 app_name/config.py 中,将新设置添加到 class AppnameConfig(Config) 中 3. 在要用到的文件中引用 from app_name.config import CONFIG

Env variables are not taken into consideration since they are relatively rare, and do not share the hierarchy structure.

As for now, only part of django configuration and "service" can be set with env vars.

boot.config.absolute_path(path: str) str[源代码]

Sphinx生成文档时执行目录是错误的,所以要用这个函数

参数:

path (str) -- 相对于项目根目录的路径

返回:

绝对路径

返回类型:

str