.env file handler. required for django, docker, etc
Project description
Installation
$ [sudo] pip install env-file
Classes
class | __doc__ |
---|---|
env_file.EnvFile |
.env file class |
Functions
function | __doc__ |
---|---|
env_file.get(path='.env') |
return a dictionary wit .env file variables |
env_file.load(path='.env') |
set environment variables from .env file |
Examples
Django example
.env
DJANGO_SETTINGS_MODULE = project.settings
DJANGO_SECRETKEY = somerandomkey
DB_NAME=dbname
DB_PASS=secret
manage.py
import env_file
import sys
if __name__ == "__main__":
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
env_file.load()
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
env-file-2019.4.13.tar.gz
(2.3 kB
view hashes)