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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yade-0.1.3.tar.gz.
File metadata
- Download URL: yade-0.1.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8e94635647925b6d741b2211b60c118a75ee31cb5d612560f64875685ea4bc
|
|
| MD5 |
59bcbaa126d34895b2891864176a661a
|
|
| BLAKE2b-256 |
87eb4876d089491be5d5dcff23492233ea18f953e5eb33f050741337fe997124
|
File details
Details for the file yade-0.1.3-py2.py3-none-any.whl.
File metadata
- Download URL: yade-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a461d16abb2d17b5de8d82f48907101fd4947bd72a62e04b2a9a0d4113de48b2
|
|
| MD5 |
7563dd94d0d731fdf62d518b876d2f2d
|
|
| BLAKE2b-256 |
f3bd8b4004170efcf9eb7483e660a94c72417fba6ed220d708c25a69b09f48b0
|