简体   繁体   English

配置多租户

[英]Configuring multi-tenancy

In a local dev env, I'm currently attempting to hack my way to multi-tenancy using Mezzanine: 在本地开发环境中,我目前正在尝试使用夹层程序破解多租户的方式:

Mezzanine makes use of Django's sites app to support multiple sites in a single project. 夹层利用Django的站点应用程序在单个项目中支持多个站点。 This functionality is always “turned on” in Mezzanine: 此功能始终在夹层中“打开”:

That's pretty much as far as an entry-level tut for multi-tenancy on mezzanine gets. 对于夹层式多租户入门级入门级学生来说,这差不多。 Great, so I go to the admin site, and add a site: 很好,所以我转到管理站点,并添加一个站点:


Domain name-----|----Display name 域名----- | ----显示名称

127.0.0.1:8000----|----English Site 127.0.0.1:8000----|----英语站点

127.0.0.1:8000/es|----Spanish Site 127.0.0.1:8000/es|----西班牙站点


Now, I am stuck. 现在,我被困住了。 I have fiddled around with url.py, but figured that's not where to start, considering I need to know something to map the url to. 我摆弄了url.py,但考虑到我需要知道一些将url映射到的内容,这并不是从哪里开始。 Views? 看法? Lost. 丢失。

Any ideas? 有任何想法吗?

(Included translation is not an option given the web service will never translate as good as a human.) (由于Web服务将永远无法像人类一样翻译,因此不能选择包含翻译。)

Multitenancy in mezzanine is done via domain names. 夹层中的多租户是通过域名完成的。 You will need to run http://dev.site and http://esdev.site or similar in development (add the entries to your hosts file and make sure they match the listings in the sites part of admin). 您将需要在开发中运行http://dev.sitehttp://esdev.site或类似版本(将条目添加到您的hosts文件中,并确保它们与admin网站部分中的列表匹配)。

In production you'll also want to use two different domains too. 在生产中,您还需要使用两个不同的域。

For example, my personal site http://dpn.name/ and my business site http://behest.com.au/ are both running off the same mezzanine install. 例如,我的个人站点http://dpn.name/和商业站点http://behest.com.au/都运行同一夹层安装。

Later on when you have the right setup, you'll be able to add new posts and pages to each specific site by either logging into the admin via each domain name, or changing the currently active site in the admin (the drop down is in the top right if you have multiple sites set up) 稍后,如果设置正确,您就可以通过每个域名登录到管理员,或更改管理员中当前处于活动状态的站点,从而在每个特定的站点中添加新的帖子和页面。如果您设置了多个网站,则位于右上角)

Hope that helps, please let me know if you need more info. 希望对您有所帮助,如果您需要更多信息,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM