Django中的多租户SAAS [英] Multi-tenant SAAS in Django

查看:400
本文介绍了Django中的多租户SAAS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用PHP / Laravel开发了多租户SAAS应用程序,但是最近我面临着用Django / Python开发一个应用程序的挑战。虽然我仍在学习Django,但我非常喜欢Django rest framework(DRF)。但是我很难找出下面突出显示的区域,如果有人显示一些光线,我会很高兴:

I have developed Multi-tenant SAAS apps in PHP/Laravel but recently I had a challenge to develop one in Django/Python. I am still learning Django though and I really like Django rest framework (DRF). But I have difficulties to figure out the highlighted areas below, If someone shows some light, I will be good to go:


  1. 如何处理子域/域并选择正确的租户数据库

  2. 如何在Django中管理和动态处理不同的数据库

  3. 仍然可以管理多租户应用程序后端来自Django管理界面

  4. 我将使用队列和其他应用程序缩放技术,需要技巧和窍门

  5. 任何示例
  6. >
  7. 通过Django开发SAAS时遇到的任何挑战经验

  1. How to handle subdomains/domains and selecting the right tenant db
  2. How to manage and dynamically handle different database in django
  3. Can multi-tenant apps backend still be managed from Django admin interface
  4. I will be using queues and other apps scalling techniques, need tips and tricks if any
  5. Any example out there
  6. Any challenge experience when developing SAAS through Django


推荐答案

...


  1. django-subdomains

  2. a> people 在SO中问过有关Django中动态数据库的问题(包括... )。我不确定我能完全理解动态处理不同的数据库的意思,所以我想只需转到我刚才提到的链接,然后为您的项目选择最佳链接。 (另外-也许这更相关?)

  3. 签出 django-multitenant -schemas 这个答案也是

  4. 曾经有一段YouTube上的视频(世界上最大的Django应用之一),解释了他们如何处理缩放。在此处关于该主题的另一篇有趣的文章 。此外,传说中的SO问题是否进行Django缩放

  5. (和6)。查看此答案

  1. django-subdomains
  2. There are people who asked in SO questions about dynamic databases in django (including, ahem... me). I'm not entirely sure I understood what you mean by "dynamically handle different database" so I guess just go to the links I just mentioned and pick out the best one for your project. (also - perhaps this is more relevant?)
  3. Check out django-multitenant-schemas and this answer too.
  4. There was a video of the guys behind Disqus (one of the largest django app in the world) explaining how they handle scaling. Here another interesting article on the subject. Also, the legendary SO question Does Django Scale.
  5. (and 6.) Check out this answer

我希望足够详细。我知道这可能是一个令人失望的仅链接的答案,但这是事实。Django是一个较新的框架,使用python进行Web开发仍然不如php常见。考虑到这一点,请理解,尽管django非常出色(而且很棒),但随着需求的增加,您将需要自己做更多的事情。

I hope that's detailed enough. I know this might be a disappointing only-links answer, but this is the reality of it - Django is a newer framework, and web development with python is still less common than php. With that in mind, understand that for all the awesomness of django (and it is awesome), with more complex needs there's more you'll have to do yourself.

在这种情况下,您必须弄清楚如何分别完成各个步骤,然后将其合并。例如,您可以轻松地找到一种创建REST django应用程序的方法,但是随后您需要弄清楚如何将其与另一个软件包(例如上述子域)结合使用。

In this case, you'll have to figure out how to do each part of the way seperatly and then combine it all. You can easily find a way to create a REST django app for example, but then you'll need to figure out how to combine it with another package (such as the above subdomains).

您可以找到百万个使用django做怪异事情的人的例子。它真的很强大(当我了解到动态模型时,我被震撼了)。但是,您的应用越复杂,您需要做的就越多。

You can find a million examples out there of people doing freaky things with django. It's really powerful (when I learned about dynamic models I was blown away). But the more complex your app, the more you'll need to do yourself.

一次拾起它,然后针对您遇到的特定问题返回SO(或 django用户google组)。祝你好运!

Pick it up, one step at a time, and come back to SO with specific issues you're having (or the django users google group). Good luck!

这篇关于Django中的多租户SAAS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆