My site has several global configurations. For example, "smtp server address", "company address", etc.
Of course I can:
- Create variables in
settings.py and use them in templates and applications; - Create a model (for example,
Configuration ) and write all the necessary fields there.
If I use the first method, I cannot give access to change these fields in django-admin.
If I use seconds, this is not a beautiful solution, because everywhere in the code I will use model_name.objects.get(id=1) , and I need only one instance. Models were created for other tasks.
How can I solve this problem?
python django django-admin
Skyfox
source share