.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.16.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for env_file-2019.3.16-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de00bd8da95a4c1d2ad54aa7b0989931531dc65e74adefbb039b520733124659 |
|
MD5 | a0e58fd4d35a061507d3e849143fb2fc |
|
BLAKE2b-256 | 77b2043ab4830ceeb7fea22f0ceb4ff5d41eeb2290dc53e348e90bfc84da8b25 |