Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple sites per tenant. #28

Closed
chrisfranklin opened this issue Feb 28, 2013 · 8 comments
Closed

Multiple sites per tenant. #28

chrisfranklin opened this issue Feb 28, 2013 · 8 comments

Comments

@chrisfranklin
Copy link
Contributor

I would like to enable support for django.contrib.sites for tenants. To do this I propose adding an extra model. I propose we call the model ClientSite and have a ForeignKey relationship to Client (or the abstract model it inherits from). What do you reckon? Does this sound feasible?

@chrisfranklin
Copy link
Contributor Author

The other way to do this would be with wildcard subdomains e.g.

tn1.example.com - First site record
site1.tn1.example.com - Second site record

Perhaps with a package such as: https://github.com/tkaemming/django-subdomains

I am aware that using the above approach is a design decision for me to take, my question is does the current middleware ignore subdomains or will it try and treat them as separate clients and therefore separate schemas?

@bernardopires
Copy link
Owner

Could you please elaborate why you need the sites app? Wildcard subdomains are not possible right now, but you can have as many subdomains as you want pointing to the same schema. Is this a reasonable solution? I'd avoid creating a new model.

@chrisfranklin
Copy link
Contributor Author

Yeah I just need multiple sub domains on one schema, it should just be a case of stripping the sub domain off like you are doing with www and dev in the middleware.

@bernardopires
Copy link
Owner

If you don't need wildcard subdomains and you know exactly which subdomains you need, you should actually be able to do this without having the change the middleware. Each subdomain has to be a tenant, but they can use the same schema. You can have one tenant for tn1.example.com and another tenant for site1.tn1.example.com, and both pointing to the same schema.

@bernardopires
Copy link
Owner

chris can i close this or do you have any other question?

@humbled
Copy link

humbled commented Mar 16, 2013

Does this mean that sites listed as mandatory in the docs is incorrect?

TENANT_APPS = (
    # The following Django contrib apps must be in TENANT_APPS
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sites',

(install.html)

Thanks

@bernardopires
Copy link
Owner

Hi Brad,

I'd very grateful if you could test again if these contrib apps are still
mandatory. I fixed an issue last week with how tenants are synced so there
shouldn't be any mandatory apps anymore. The sites app is for sure not
mandatory, I myself don't use it.

2013/3/16 humbled notifications@github.com

Does this mean that sites listed as mandatory in the docs is incorrect?

TENANT_APPS = (
# The following Django contrib apps must be in TENANT_APPS
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sites',

(install.html)

Thanks


Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-15002804
.

Bernardo Pires Carneiro

@humbled
Copy link

humbled commented Mar 16, 2013

I'll try to test them, sure. Still have very patchy results for now so will be a while before I can test with any confidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants