My site has few global configurations. For example "smtp-server address", "company address", etc.
Of course I can:
- Create variables in
settings.py
and use it in templates and apps; - Create a model (like
Configuration
) and write all needed fields there.
If I use the first way I can't give access for changing these fields in django-admin.
If I use the seconds way it is not a beautiful solution, because everywhere in the code I have to 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?