1👍
✅
I think for this case it better to use existing solutions like Constance – Dynamic Django settings. It is general solution for modifiable variables through django admin interface.
Here is list of similar apps https://djangopackages.org/grids/g/live-setting/
2👍
You could use python’s shelve for a simple out-of-the-box solution for object persistence. It’s easy to use:
with shelve.open('my_store') as my_store:
my_store['ranking'] = 10
and then:
with shelve.open('my_store') as my_store:
ranking = my_store['ranking']
Hope this helps!
- [Django]-Unresolved Imports in VS Code Django Project
- [Django]-Dynamic Loading of Modules then using "from x import *" on loaded module
- [Django]-Adding hours and days to the python datetime
- [Django]-Text choices attribute not recognised
- [Django]-Django, remove initial space of a template value in a textarea
Source:stackexchange.com