bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.46k stars 424 forks source link

Possibility of using more than one domain route to a single tenant #317

Open vinitkumar opened 8 years ago

vinitkumar commented 8 years ago

I have been using your app in production for almost 2 years. Thanks for your work, it made building our multitenant CMS so much easier and cleaner. What do you think about the ability of the django tenant schemas to route more than one domain to a single tenant. For eg: one.multicms.com and two.multicms.com could be both routed to a single schema common? I am happy to contribute to it if you think it's a good idea to add this feature in the core. Let me know your views about this.

Thanks! Vinit

ashwoods commented 8 years ago

couldn't you do this in front of django? the domain itself is just a logical but arbitrary way of defining a tenant.

vinitkumar commented 8 years ago

It would more more logical to me to add all those tenant urls I want to route to a particular tenant than writing that custom logic anywhere else. The tenant schema middleware actually does that (for single tenant and url), right?

ashwoods commented 8 years ago

then just do so. create an alias model and replace the middleware with one that checks for aliases too. what I am saying is that the domain isn't really a domain. not sure if it makes sense what I am saying ;)

bernardopires commented 8 years ago

https://github.com/bernardopires/django-tenant-schemas/pull/310 does exactly what you want. It's really a matter of the schema name no longer being unique, that's the only changed required.

vinitkumar commented 8 years ago

Cool, Thanks @bernardopires. Any plans to merge this pull request soon?

dszmaj commented 8 years ago

It would be great feature :)