Django settings - customize attributes per Site from admin

28 views
Skip to first unread message

Pablo Camino Bueno

unread,
Jun 6, 2017, 10:32:16 AM6/6/17
to Django users

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?

Melvyn Sopacua

unread,
Jun 6, 2017, 9:02:59 PM6/6/17
to django...@googlegroups.com

On Tuesday 06 June 2017 06:42:07 Pablo Camino Bueno wrote:

 

> 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?

 

Take a look at mezzanine.conf for inspiration.

--

Melvyn Sopacua

Reply all
Reply to author
Forward
0 new messages