Skip to main content

handle the environment variables as from a file in a simpler way.

Project description

A install

pip install django-envfile

Created file .env

DJANGO_SECRET_KEY="ko8n3#^m#67+p@bvx#1xp0om+!zo@&l8-*8n(c#47n)=!3t$hd"
DJANGO_DATABASE_HOST=database
DJANGO_DATABASE_NAME=cerezo_master

In settings.py

from pathlib import Path
from os.path import join, abspath
from envfile import loadenv # django-envfile

BASE_DIR = Path(__file__).parent.parent  # src

location = lambda path: abspath(join(BASE_DIR, path))
loadenv(location('.env')) # Paths file .env

SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "Ahri")

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

django-envfile-0.1.5.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file django-envfile-0.1.5.tar.gz.

File metadata

  • Download URL: django-envfile-0.1.5.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.0

File hashes

Hashes for django-envfile-0.1.5.tar.gz
Algorithm Hash digest
SHA256 994bcfd7c61b6ae2d27b3cf68aba5f1aa381eabc365a9e68811cd9c7cc8a6a3c
MD5 27d95334e3e51a948eba7a1e3d3041ac
BLAKE2b-256 d9d3820e65b12afd66cd5494c7cc2808e974841e0675142cdb0714f70d29edce

See more details on using hashes here.

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