Tuesday, June 6, 2017

Django settings - customize attributes per Site from admin

Hi, I'm using django sites framework.


I've a model with a OneToOneField to Site model. This way the admin users can customize each site attributes from the admin panel.


class CustomSite(models.Model):      site = models.OneToOneField(Site)      email_host_user = models.EmailField()      ...


Some of these fields are actually values that should be used in the settings file, like EMAIL_HOST_USER.


How can I use these values in the settings file of the custom sites? is this the correct approach?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7b764372-ae9e-4b02-a5a9-e4909f1a0885%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment