4

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 APIs
  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

0

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Django Tastypie is one of the best REST API frameworks that I have used. The bit about "can call C++ code" - to the best of my knowledge, no REST framework does that out of the box; but wrapping C++ code in Python is eminently doable, and there are several approaches eg Swig ( swig.org )
0

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.

4 Comments

Thanks. But, I read somewhere that there is only experimental support for RESTful APIs in web2py. And, how does web2py compare to Django in terms of speed and framework stability, which has excellent documentation and community support around it? No flamewars please.
RESTful API support was experimental a few months ago, but now I think it's more stable (though if you have suggestions for improvement, I'm sure they would be welcome). In terms of speed, the framework itself should be comparable to Django. If anything, I think the web2py DAL (database abstraction layer) tends to be faster than ORMs. web2py itself has been around for nearly four years and is quite stable. Although it is under active development (new releases every month or so), it has maintained backward compatibility of the documented API since its initial release.
Although Django certainly has a larger community, web2py has a good size community that is very active, supportive, and continually growing.
Thanks Anthony. That was certainly helpful. :) I'll surely try out web2py.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.