Constance register - constance for third-party packages
Features:
- Easily add settings to global constance config from third-party packages or project applications
How to use it
Install constance and constance register
>>> pip install django-constance django-constance-register
Add constance to INSTALLED_APPS
INSTALLED_APPS = (
...
'constance',
'constance.backends.database',
'constance_register',
...
At the end of settings file add
from constance_register.conf import conf
# Path to your files with configs.
# NOTE: Files are loaded before apps are ready
CONSTANCE_REGISTRY = [
'library.apps.shelf',
'library.apps.staff'
]
# Load settings
conf.load()
# Add third-party settings to global settings
CONSTANCE_CONFIG = {
'THE_ANSWER': (42, 'Answer to the Ultimate Question of Life, '
'The Universe, and Everything'),
**conf.settings()
}
# Same with fieldsets
CONSTANCE_CONFIG_FIELDSETS = {
**conf.fieldsets()
}
Add your settings to config.py file.
Config file example.
# library.apps.staff.config.py
from datetime import date
app_name = 'staff'
CONFIG = {
'DATE_ESTABLISHED': (date(1972, 11, 30), "the shop's first opening"),
'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
'MULTILINE': ('Line one\nLine two', 'multiline string'),
}
FIELDSET = {
'General Options': {
'fields': ('DATE_ESTABLISHED', 'MY_SELECT_KEY'),
'collapse': True
},
'Theme Options': ('MULTILINE',),
}
Metadata
Release files for django-constance-register 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-constance-register-0.2.0.tar.gz | 10.4 kB | Without provenance | Details for django-constance-register-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_constance_register-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for django_constance_register-0.2.0-py3-none-any.whl |
Total release size: 28.8 kB
Release files / django-constance-register-0.2.0.tar.gz
| Download URL | django-constance-register-0.2.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0409b8cea288e00534432c6d1b2ed520157e625acb0c6725611e9e4644297e7c
|
|
BLAKE2b-256 checksum How to use checksums |
0e1a01e2de88ca3c30c280c07aed52e7ec3b6fcf898d10d956f7169a81386873
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
DepHell/0.8.3
|
Release files / django_constance_register-0.2.0-py3-none-any.whl
| Download URL | django_constance_register-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dcfaa66c830bb74b595284acfdb7200c7cae506f68730a6983ed7fadb93f46f
|
|
BLAKE2b-256 checksum How to use checksums |
0da3a790e7fb9a05e62bf5d559b43409f2a221a01243f952d24f7798ee34992a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
DepHell/0.8.3
|
Security for django-constance-register 0.2.0
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.