开发者

Python framework for REST API on top of a C++ application

I am developing a C++ application, which is basically a trading engine. The trading engine will have two front-ends, a Qt C++ based application running on a desktop and a web application.

Architecturally, I think it makes sense to have a layer REST API built on the top of a C++ engine, and then Qt C++ application and web application accessing this common API. I am looking for a Python web framework which can do the following:

  1. Create REST AP开发者_JAVA技巧Is
  2. Handle Authentication
  3. Make lookups from the database and occasional UPDATE/INSERTs (I'm not sure if I need an ORM)
  4. Low learning curve (and has good documentation)
  5. Can call C++ code (I'm hoping it would be simple to do this with Boost::python)
  6. Can scale horizontally

Updated: added scaling and documentation part


focusing on simplicity you might take a look at django-tastypie which is a plugin for django to create REST APIs on top of the django framework. the API is really easy to learn and frees you from anoying things like URL routing, getting segments of the URL as parameter into your handler, serializing incoming and outgoing request/response data... to the scaling aspect: my approach would be to let the python server speak to the c++ via a JSON RPC Interface, than run the server behind nginx UPDATE use django-tastypie instead of django-piston


This isn't documented in the online book yet, but web2py has recently added some functionality for creating RESTful APIs. web2py is also very easy to learn, and should be able to meet your other requirements as well. If you need help/advice, ask on the mailing list.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜