Skip to main content

Yet another Django env

Project description

Yet another Django env (yade)

Simple library to set Django settings through environment variables in a way, inspired by ASP.NET Core.

Examples of variables, which will affect settings:

DJANGO__STATIC_URL  # Just string variable
DJANGO__REST_FRAMEWORK__PAGE_SIZE  # Dict value
DJANGO__AUTH_PASSWORD_VALIDATORS__0__NAME  # List value

True/False or ints (0,1,2...) values of env variables will be converted to python type (bool or int). Json like arrays like [1, 2, 3]are supported too.

Installation

pip install yade

Usage

In settings.py:

from yade import update_settings_from_env

ALLOWED_HOSTS = ['*']
...  # Your settings here

update_settings_from_env(locals())
# End of file

Notice: this work only in modules, not in functions!

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

yade-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yade-0.1.2-py2.py3-none-any.whl (3.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file yade-0.1.2.tar.gz.

File metadata

  • Download URL: yade-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for yade-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e9defef23fe513874c9bf2664a04a30a95307439fd9698eb5bd0d560eebee881
MD5 6b3753c7226f682a81403de6a3207bad
BLAKE2b-256 b77e5c9027cb752c7df7943a1f73b0bd5ee171a82ee06fc67414335cc62b4965

See more details on using hashes here.

File details

Details for the file yade-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: yade-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for yade-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f2c711a7990b8afa10a7fa969c84eb46510e7e74f245c9d2ace29d2265b43cd9
MD5 03a03b2536dfcf5a19b5d632bfeb11a8
BLAKE2b-256 27beda472e3861f7a8012a5c53ccdebdebfeca0496a38b98875d0180c5d58f98

See more details on using hashes here.

Supported by

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