Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

修改 test 或者 dev 环境的设置方式 #2

@wingfish

Description

@wingfish

在jman 中实现是通过配置文件中设定 testing,development 等的,根据最佳实践的原则,修改为环境变量方式。

也就是不再用下面这类方式
···
server_status = jarvis_man.dt['server']['status']
···

而是用
export FLASK_ENV=development
这样来定义

并在配置文件中类似下面方式读入。

···
ENVIRONMENT_DEBUG = os.environ.get("DEBUG", default=False)
if ENVIRONMENT_DEBUG.lower() in ("f", "false"):
ENVIRONMENT_DEBUG = False
···

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions