Python / Django multi-tenancy solution -
i use creating plan of attack project i'm working on.
imagine site group oversees regional sales offices, distributed around world. purpose of project let superusers spin new sub-site specific each , every office, @ fast pace -- sites added on frequent basis. office sub-sites should wholly contained "admin" users specific sub-site , should user-friendly cms. superuser should able step in , manage of these office sub-sites.
in addition self-contained office sub-site instance, there need each sub-site manage contacts, leads, etc , store in 1 central area superusers.
i've done few sites using django, never multi-tenant. i'd suggestions technologies use or tutorials/documentation might helpful.
requirements:
- each sub-site uses same source (templates, js, available features, etc), can modified reflect custom content within templates.
- assigned subdomains (with option of using qualified domain) per sub-site, configured within project, not in hardcoded settings file.
- sub-site specific user access controls, in addition superusers can access sub-sites.
- the ability provide "independent" cms each sub-site. i.e., sub-site admin sees content. preference project django-cms, i'm open suggestions.
- support apps pool data sub-sites, limit sub-site "admins" viewing records app.
considering above, approach recommend? open reconsidering technologies, stick python.
there great app called django-tenant-schemas uses postgresql schemas mechanism create multi-tenancy.
what specyfing shared_apps contain objects shared across schemas (sub-sites), , tenant_apps contain objects specific sub-site, i.e. users, records etc. schemas isolated each other.
each postgresql schema tied domain url, middleware checks host part of request , sets db connection's schema appriopriate one.
in addition, allows define public_schema_urlconf allows specify urlconf file public schema - meta site not tied sub-site.
Comments
Post a Comment