Skip to main content

.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)

python-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for env-file, version 2019.4.13
Filename, size File type Python version Upload date Hashes
Filename, size env-file-2019.4.13.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page