Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python websocket based application framework / server

I want to write an 'cloud' based application to interactivly develop games. I'm developing apps and tools in Python for years, but so far they were not in 'client <-> server' model.

I don not want to get any comparison. I want to ask experts, which tool is able to solve this specific problem

I was digging for over two weeks for right solutions and I found a lot of different servers/frameworks. I'm new to client-server world, so I'm not able to judge the real strengths or weaknesses of these libraries.

I will heavly use websockets (Python on the server side, js on the client side) and I want to choose best possible Python server / framework.

The question is, which python server/framework:

  1. will be suitable for big cloud based application development
  2. will give me possibility to easly use websockets
  3. will provide good scalability - I want to serve a lot of users
  4. will give me good, sutiable framework for developing such application (or should I develop my own framework based on server like Tornado?)
  5. will be fast (with above assumptions)
  6. will allow me to use some websocket based 'rpc' solutions between client and server

The solutions I found during my research include:

  • Django
  • Tornado
  • Twisted
  • Cyclone
  • gevent + gunicorn
like image 760
Wojciech Danilo Avatar asked Jun 20 '26 10:06

Wojciech Danilo


2 Answers

If you want to use Python only, then Twisted is a nice option to go with. Django has no web sockets implementation, though there are few projects at github, but still it is not recommended since Django runs on wsgi. Tornado is good with websockets too.

If you are at a beginning stage and exploring options, I strongly suggest, go with Node.js. It is awesome for asynchronous event handling. As name only suggests, its javascript not some python framework.

like image 62
Sushant Gupta Avatar answered Jun 21 '26 23:06

Sushant Gupta


You may try http://websockets.readthedocs.io/en/stable/intro.html There is a small demo using it with Python3.5 that I have uploaded https://www.youtube.com/watch?v=BgpPm9N338s

like image 44
Yotam Avatar answered Jun 22 '26 00:06

Yotam