开发者

Server Topology Help - Django and Twisted Possibility?

I am currently working on a complex web interface and backend, that will need to address several issues.

  • Scalablility
    • multiple deployments of varying load demands
  • Very structured authorization groups
    • Different views for different user groups
    • admin panel
      • user/content management
  • Large managed database
    • current
    • long term stored data (histories)
  • Data Updates
    • Polling
      • Ex. Search queries, static pages/files, report generation per request
    • Pushing (likely websockets)
      • Ex. Real-time notifications
  • Varying protocols
    • Ex. HTTP, SSL, Websockets

I would like to use Python, because I have grown to really enjoy the language, and I am considering some combo of Django and Twisted.

I have some experience with Django, which I love for its MVT style of application programming, its authorization models, its admin panel, and its database API. However, it is not so strong in some of开发者_StackOverflow中文版 the data requirements that I need, in particular, the real-time aspects.

Now, I have not really used Twisted before, but I have seen many interesting things to it. In particular the async aspects, and the ability to run many protocols.

The problems in getting the two to work together are obvious in that Django is a blocking server and Twisted is designed to be non-blocking. I have seen some topics stating using the two together is possible and have had success with it. It also seems possible to run both and proxy them to accept different urls, but getting the authentication over the two may become tricky?

Having said all of that, I would like to ask if I am on the right track for implementing this system, as well as suggestions on how to use the two together, alternatives, or if I should just kick one out (at this point, I guess it'd have to be Django, because the real time stuff is necessary). I should mention that I have written some of the preliminary data models and views in Django already.

I am quite experienced on the client side of things (JS,CSS,HTML), but I am not so savvy in the server side of things. Any input would be helpful, thanks.


You can definitely use Twisted with Django. Several projects have used the two together to good effect. twistd web --wsgi provides a basic way to get it set up, and there's a great example with more bells and whistles, like static content by Alex Clemesha on github.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜