Skip to main content

DjEnv (Django + Environment): Load Django Settings from Environmental Variables

Project description

DjEnv: Django + Environment

Load Django Settings Directly from Environmental Variables

features

  • modify django configuration without modifying source code
  • prevent hard-coding of Django settings
  • works great with Docker

install

with pip

pip install djenv

with pipenv

pipenv install djenv

basic usage

# inside settings.py

# import settings from environment
from djenv.settings import *

Prepend Settings with DJANGO_ to import them. For example:

DJANGO_DEBUG=False python3 manage.py runserver

Will set DEBUG=False in the settings.py

advanced usage

You can also replace nested settings like DATABASES by setting a JSON

DJANGO_DATABASES='{ "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": "db.sqlite3" } }'  python3 manage.py runserver

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

djenv-0.0.6.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file djenv-0.0.6.tar.gz.

File metadata

  • Download URL: djenv-0.0.6.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for djenv-0.0.6.tar.gz
Algorithm Hash digest
SHA256 7967e97389a5c4f702663578efaabc51e41983c23c09adce675e712e31f21d99
MD5 86d6f1d5361f62a948f6f51678f5d04f
BLAKE2b-256 c4a33b72edf1dd7485366bd374a133ed93c5b5b382e536d424508e56ece26945

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