.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.3.22.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for env_file-2019.3.22-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da49b5057c90cf3ad41ea1ed58bf940eab554577599d465bdc279f60576dbb36 |
|
MD5 | abeadcdedb45192c9acc9650f3f87b79 |
|
BLAKE2b-256 | 303a79a2ad64478df3e5e884e6dd2fd2e39642273b913692f374139834e46e23 |