0

I want to develop an extremely lightweight web service with a RESTful JSON API. I will do all the session management on the server side. The solution will receive several 100k (or more) API calls an hour and return (compressed) JSON as response, it should be able to scale effortlessly.

Security is naturally important, but I want to avoid heavy weight frameworks like Django etc, and preferably will use a webserver like nginx or lighttpd instead of Apache.

At the server end, this is all I need:

  1. user session management
  2. security (protection against atleast the more common attacks such as cross site request forgery etc)
  3. url routing
  4. http utilities (e.g. compression)

I am aware of web2py, but its deployment options seems 'not well though out' at best - so far, I have been unable to get it to work with Apache, despite following the user manuals.

Can anyone suggest a python framework (and web server) best suited for this task?

1
  • Are the API calls rather static in what they return or very dynamic? If you combine Django with Varnish for caching, it should work well. It's hard to say if Django will prove to be the bottleneck, at least it provides all the functionality you need. Commented Jun 15, 2012 at 8:41

2 Answers 2

3

if you want to go really lightweight, you might try wsgi itself without a framework, or maybe Flask. I understand wsgi runs on lighttpd, you'll get some hits on a Google search.

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

Comments

1

Try Pyramid. It's fast, lightweight and with a lot of options to configure your enviroment as you like...

Comments

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.