django-classy-settings
Minimalist approach to class-based settings for Django
https://django-classy-settings.readthedocs.io/latest/
Quick Start
In your settings.py
from cbs import BaseSettings, env
...
# For env settings with a DJANGO_ prefix
denv = env['DJANGO_']
class Settings(BaseSettings):
DEBUG = denv.bool(True) # Controlled by DJANGO_DEBUG env var
DEFAULT_DATABASE = denv.dburl('sqlite://db.sqlite')
def DATABASES(self):
return {
'default': self.DEFAULT_DATABASE,
}
class ProdSettings(Settings):
DEBUG = False
@env
def STATIC_ROOT(self):
raise ValueError("Must set STATIC_ROOT!")
__getattr__, __dir__ = BaseSettings.use()
Switch between Settings and ProdSettings using the DJANGO_MODE env var:
# Run default Settings
$ ./manage.py test
# Run ProdSettings
$ DJANGO_MODE=prod ./manage.py test
Metadata
Release files for django-classy-settings 3.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_classy_settings-3.0.7-py3-none-any.whl | Python 3 | none | any | Details for django_classy_settings-3.0.7-py3-none-any.whl |
Release files / django_classy_settings-3.0.7-py3-none-any.whl
| Download URL | django_classy_settings-3.0.7-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2021f1bcebb9770047867eba003ae8ce280f46cf6a27a75cff8f8635ad64b85
|
|
BLAKE2b-256 checksum How to use checksums |
52cae2350391f5c59bf976a1dfd6ddd80ee5a6d956abe09a3c31ac9b27cafaf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for django-classy-settings 3.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.