Could we make the sites portion of Django an interface? In settings you give something like SITES_PROVIDER = 'myapp.sites.MultiTenancySite', and that provider then needs to fulfill a given API. This way we wouldn't need to offer anything complex in-built, but users would be free to do whatever they want to.
- Anssi On Saturday, January 30, 2016 at 11:11:08 AM UTC+2, Aymeric Augustin wrote: > > This is a valid use case, but not one django.contrib.sites (officially) > supports, since it requires a constant SITE_ID setting. > > While Tim's suggestion doesn't cause a regression, it doesn't make this > pattern easier to implement either. > > It's definitely worth considering. > > -- > Aymeric. > > > Le 30 janv. 2016 à 08:01, Max Arnold <lwa...@gmail.com <javascript:>> a > écrit : > > > > What if this list of sites needs to be changed dynamically without app > restart (multitenancy)? > > > >> On Fri, Jan 29, 2016 at 12:45:02PM -0800, Tim Graham wrote: > >> In another thread about adding a "scheme" field to the Site model [1], > I > >> floated the idea of moving the data stored by the Site model into a > setting: > >> > >> I've sometimes thought that the Site model violates the principle that > you > >> shouldn't put configuration in your database. I guess there's some > >> usefulness to having a ForeignKey to the site, but... would it be > feasible > >> to offer a SITES setting that could be used instead? e.g. > >> > >> SITES = { > >> 1: {'scheme': 'http', 'domain': example.com, 'name': 'My Site'}, > >> ... > >> } > > > > -- > > You received this message because you are subscribed to the Google > Groups "Django developers (Contributions to Django itself)" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to django-develop...@googlegroups.com <javascript:>. > > To post to this group, send email to django-d...@googlegroups.com > <javascript:>. > > Visit this group at https://groups.google.com/group/django-developers. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/20160130070141.GA2770%40otg.dm. > > > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/2014647b-aa3d-412f-8fc3-a0bc646e9a4e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.