Skip to content

Use .env file for environment variables. #4

@adriaanwm

Description

@adriaanwm

Currently we have production.py and local.py files. For a config var, say FACEBOOK_API_SECRET we then have

FACEBOOK_API_SECRET = os.environ.get('FACEBOOK_API_SECRET')

for production.py, and

FACEBOOK_API_SECRET = 'some development secret'

for local.py.

Instead we could put all os.environ.get config in the common.py . Any environment variables can be set on local in a .env file like

export SENDGRID_SECRET='another secret'
export FACEBOOK_API_SECRET='some development secret'

and in make run we can add a call source .env to load the environment variables.

The benefit would be that the config will be less error prone (from adding a config variable in local and not updating it in production, or changing the name of one and not the other).

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