从.env.example模板文件自动生成.env文件
dotenver的Python项目详细描述
从模板生成dotenv(.env)文件的python应用程序。
快速启动
安装python dotenver
$ pip install dotenver
创建一个.env.example
# Full line comments will be kept# Simple usageNAME=## dotenver:first_name# Pass parameters to fakersENABLED=## dotenver:boolean(chance_of_getting_true=50)# Name your valuesMYSQL_PASSWORD=## dotenver:password:my_password(length=20)# And get the same value again, when the name is repeated.DB_PASSWORD=## dotenver:password:my_password()# Output your values within double or single quotesDOUBLE_QUOTED=## dotenver:last_name(quotes='"')SINGLE_QUOTED=## dotenver:last_name(quotes="'")# Literal values are possibleSTATIC_VARIABLE=static value# export syntax can be usedexport EXPORTED_VARIABLE=exported
从cli运行pythondotenver
$ dotenver -r
现在有了一个新的.env文件可以使用。
有关更多使用选项,请运行
$ dotenver -h
码头工人
一张码头工人的照片。要使用它,请将源代码装载到 /var/lib/dotenver/并运行容器。
$ docker run --rm -v `pwd`:/var/lib/dotenver/ jmfederico/dotenver