Skip to main content

.env file handler. required for django, docker, etc

Project description

Install

$ [sudo] pip install env-file

Classes

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)

readme-md - README.md generator

Project details


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.2.25.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

env_file-2019.2.25-py2.py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page