Comments (6)
Hello bogeymin,
thank you very much for your feedback! From your user case, I wonder if simply having multiple lines with the same schema_name would work? The field schema_name does not need to be unique, so I think you should also be ok without having to change any code. If you want I can take a look at your code. :)
Cheers,
Bernardo
from django-tenant-schemas.
The schema_name (and domain_url) field is currently a varchar, but isn't it the domain_url that gets checked to determine which schema to use? That's the situation I'm in. My admin site is located at one domain, but I need a public domain to host the non-admin views using the same schema as the admin site -- that is, I need two domain_urls to point to the same schema. It's sort of like Apacghe's ServerAlias directive which listens to more domain names but still points at the same document root.
I will fork the code and push my changes if you want to have a look.
Though I have implemented multi-tenancy in the past, and I have looked at all of the available solutions, I think Tenant Schemas is the best work I've seen thus far, and I would be happy to contribute to the project.
On Aug 12, 2012, at 5:27 PM, Bernardo Pires wrote:
Hello bogeymin,
thank you very much for your feedback! From your user case, I wonder if simply having multiple lines with the same schema_name would work? The field schema_name does not need to be unique, so I think you should also be ok without having to change any code. If you want I can take a look at your code. :)
Cheers,
Bernardo—
Reply to this email directly or view it on GitHub.
from django-tenant-schemas.
Yes, it's the domain_url that gets checked to determine the schema to use. But I'm not sure if I understood your problem correctly. You want subdomain1.domain.com/my/view to be the exact same page (and schema) as on subdomain2.domain.com/my/view, correct? If that's the case, you should be able to have your lines on the database like this:
<domain_url>
subdomain1.domain.com my_schema my_data
subdomain2.domain.com my_schema my_data
And it should work exactly as what you wanted. But it seems you have other view routing needs, as you use the same schema but have different views. And yes, I'd love to take a look at your code. It's very satisfying to see people are using and liking this app! Thanks for the compliments and I'd love your help! You can take a look at our list of issues when you have the time. :)
from django-tenant-schemas.
In this particular project, the admin site is located on one subdomain and the public site is located on another subdomain, but both use to the same database schema.
On Aug 14, 2012, at 5:12 AM, Bernardo Pires wrote:
Yes, it's the domain_url that gets checked to determine the schema to use. But I'm not sure if I understood your problem correctly. You want subdomain1.domain.com/my/view to be the exact same page (and schema) as on subdomain2.domain.com/my/view, correct? If that's the case, you should be able to have your lines on the database like this:
subdomain1.domain.com my_schema my_data
subdomain2.domain.com my_schema my_dataAnd it should work exactly as what you wanted. But it seems you have other view routing needs, as you use the same schema but have different views. And yes, I'd love to take a look at your code. It's very satisfying to see people are using and liking this app! Thanks for the compliments and I'd love your help! You can take a look at our list of issues when you have the time. :)
—
Reply to this email directly or view it on GitHub.
from django-tenant-schemas.
https://github.com/bogeymin/django-tenant-schemas/tree/develop/tenant_schemas
Changes were made in middleware.py and models.py to add a domain_aliases (text field) to effectively allow multiple domains to answer for a single tenant.
As a refresher, the feature in question is basically to allow subdomain1.example.com/admin and and subdomain2.example.com to both use the same postgres schema.
from django-tenant-schemas.
@bernardopires Is the field domain_aliases not existing in the master branch version?
from django-tenant-schemas.
Related Issues (20)
- weird behaviour using "with schema_context" HOT 3
- Can't migrate new tables to tennant apps.
- New tenant model is not creating relations in non-public schema with multiple databases
- Accessing tenants data from public. HOT 1
- django-tenants TypeError: argument of type 'TenantQueryset' is not iterable
- ImportError: cannot import name 'force_text' from 'django.utils.encoding' HOT 3
- How to create tenant_schemas.storage.TenantFileSystemStorage within AWS s3 bucket with django-storages 1.12.3
- "Apps aren't loaded yet" when upgrading from django 3.0.10 to 3.2
- Schema Deletion HOT 1
- DRF example
- Support for django 4.0 HOT 7
- how to launch tenant_command loaddata from views with fixtures HOT 1
- Supported Version Django HOT 3
- Distinguish between workspaces
- error 500 DEBUG=False in production HOT 1
- [Solution] Unable to create the django_migrations -relation already exists HOT 1
- healthcheck HOT 2
- Issue in holding DB connection consistently HOT 1
- @contextmanager
- Django-tenants - please help
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-tenant-schemas.