Django-dynamic-preferences documentation¶
Dynamic-preferences is a Django app, BSD-licensed, designed to help you manage your project settings. While most of the time, a settings.py file is sufficient, there are some situations where you need something more flexible such as:
per-user settings (or, generally speaking, per instance settings)
settings change without server restart
For per-instance settings, you could actually store them in some kind of profile model. However, it means that every time you want to add a new setting, you need to add a new column to the profile DB table. Not very efficient.
Dynamic-preferences allow you to register settings (a.k.a. preferences) in a declarative way. Preferences values are serialized before storage in database, and automatically deserialized when you need them.
With dynamic-preferences, you can update settings on the fly, through django’s admin or custom forms, without restarting your application.
The project is tested and work under Python 3.8, 3.9, 3.10 and 3.11 and with django 3.2 and 4.2.
Features¶
Simple to setup
Admin integration
Forms integration
Bundled with global and per-user preferences
Can be extended to other models if need (e.g. per-site preferences)
Integrates with django caching mechanisms to improve performance
Django REST Framework integration
If you’re still interested, head over Installation.
Warning
There is a critical bug in version 1.2 that can result in dataloss. Please upgrade to 1.3 as soon as possible and do not use 1.2 in production. See #81 for more details.
Contents:
- Installation
- Quickstart
- Bind preferences to arbitrary models
- React to updates of preferences
- Preference types
BasePreferenceType
BooleanPreference
ChoicePreference
DatePreference
DateTimePreference
DecimalPreference
DurationPreference
FilePreference
FloatPreference
IntPreference
IntegerPreference
LongStringPreference
ModelChoicePreference
ModelMultipleChoicePreference
MultipleChoicePreference
StringPreference
TimePreference
create_deletion_handler()
- REST API
- Preferences lifecycle
- Upgrade
- Contributing
- Credits
- Changelog
- 1.16.0 (2023-10-15)
- 1.15.0 (2023-04-05)
- 1.14.0 (2022-08-24)
- 1.13.0 (2022-06-12)
- 1.12.0 (2022-02-26)
- 1.11.0 (2021-10-09)
- 1.10.1 (2020-08-21)
- 1.10 (2020-07-03)
- 1.9 (2020-05-06)
- 1.8.1 (2019-12-29)
- 1.8 (2019-11-06)
- 1.7.1 (2019-07-30)
- 1.7 (2018-11-19)
- 1.6 (2018-06-17)
- 1.5.1 (06-03-2018)
- 1.5 (16-12-2017)
- 1.4.2 (06-11-2017)
- 1.4.1 (03-11-2017)
- 1.4 (15-10-2017)
- 1.3.3 (25-09-2017)
- 1.3.2 (11-09-2017)
- 1.3.1 (30-07-2017)
- 1.3 (03-07-2017)
- 1.2 (06-07-2017)
- 1.1.1 (11-05-2017)
- 1.1 (06-03-2017)
- [Major release] 1.0 (21-02-2017)
- 0.8.4 (10-01-2017)
- 0.8.3 (06-01-2017) (DO NOT USE: BACKWARD INCOMPATIBLE)
- 0.8.2 (23-08-2016)
- 0.8.1 (25-02-2016)
- 0.8 (23-02-2016)
- 0.7.2 (23-02-2016)
- 0.7.1 (12-02-2016)
- 0.7 (12-01-2016)
- 0.6.6 (23-12-2015)
- 0.6.5 (23-12-2015)
- 0.6.4 (23-12-2015)
- 0.6.3 (09-12-2015)
- 0.6.2 (24-11-2015)
- 0.6.1 (6-11-2015)
- 0.6 (24-10-2015)
- 0.5.4 (06-09-2015)
- 0.5.3 (24-08-2015)
- 0.5.2 (22-07-2015)
- 0.5.1 (17-07-2015)
- 0.5 (12-07-2015)
- 0.5 (12-07-2015)
- 0.4.2 (05-07-2015)
- 0.4.1 (05-07-2015)
- 0.4 (05-07-2015)
- 0.3.1 (10-06-2015)
- 0.2.4 (14-10-2014)
- 0.2.3 (22-08-2014)
- 0.2.2 (21-08-2014)
- 0.2.1 (09-07-2014)