[PYTHON] This is your choice for env file management!

Environment variable management

background

Sometimes I use a private key, Separate .env.sample file for sample and .env file for development

I want to manage .env with this as positive in order to leave .env.sample in the commit

Installation method

go get github.com/locona/envdef/cmd/envdef

How to use

Test data preparation

Add the application configuration to the .env file at the root of your project.

S3_BUCKET=YOURS3BUCKET
SECRET_KEY=YOURSECRETKEYGOESHERE

The .env.sample file at the root of the project

S3_BUCKET=YOURS3BUCKET
SECRET_KEY=YOURSECRETKEYGOESHERE
REGION=REGION

Run

Then run

envdef

The result is a .env.new file

REGION=REGION
S3_BUCKET=YOURS3BUCKET
SECRET_KEY=YOURSECRETKEYGOESHERE

The console also shows the changes

Summary

Using envdef makes it easier to manage environment variables that are no longer needed or added.

Recommended Posts

This is your choice for env file management!
Watchdog is quite useful for file monitoring
virtualenv For the time being, this is all!