Code Monkey home page Code Monkey logo

Comments (6)

bernardopires avatar bernardopires commented on June 22, 2024

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.

develmaycare avatar develmaycare commented on June 22, 2024

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.

bernardopires avatar bernardopires commented on June 22, 2024

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.

develmaycare avatar develmaycare commented on June 22, 2024

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_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. :)


Reply to this email directly or view it on GitHub.

from django-tenant-schemas.

develmaycare avatar develmaycare commented on June 22, 2024

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.

tobiasgoecke avatar tobiasgoecke commented on June 22, 2024

@bernardopires Is the field domain_aliases not existing in the master branch version?

from django-tenant-schemas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.