Friday, October 26, 2012

wheezy web: introduction

The key of success for any medium to high complexity system is in separation of domain concerns. Given that choice in architectural design for web framework, the development activities are split by distinct, non-dependent parts. The wheezy.web is a lightweight WSGI web framework and serves a glue purpose between various other packages developed under wheezy.* umbrella in loosely coupled way, it combines things essential for web application developer (presentation slides are here): wheezy.web framework is high quality software with special attention paid to performance, concurrency and efficiency - key characteristics for modern web endeavors. It conforms to PEP8 standard and comes with high test coverage, automated build for various python versions which form a solid foundation that is easy to maintain.

Features, you find in other frameworks, but not here:
  • web sessions: it is recommended to use fine grained caching instead, same development effort with better outcome. Take this thought: I have application with 20 handlers, each store some unique data, but only one handler serves an incoming request, so I need just data unique to my handler. With session, you receive all data, stored by various handlers... your handler done... all session data are stored back. How things go in concurrent attempts to `modify` the same session, e.g. ajax calls? It is not a problem for something small, in-memory,... but that is a huge problem as you scale and go big
  • gzip middleware: nginx do that better
  • static site caching middleware: nginx+uwsgi do that better
  • model update, validation and HTML widgets as a single `Form Library`: you will not find it here. All three are separate actors, mixing them all-in-one loose flexibility
  • ORM: `separation of concerns` tells me it distinct feature that has very little to do with web... integration is usually few lines of code regardless of web framework
  • Admin: the bloat of code can be so killing that you even don't realize where web framework ends and where mess starts. In my opinion it is distinct feature, and should evolve alone
Attention to efficiency of design is one of well distinguished key principals of wheezy.web framework. If you think there is a `cool feature` and it is missing, just go ahead and propose to add it.

What I am looking for? The python community feedback and tight collaboration.


  1. You get a mention here Good luck with your endeavours.

  2. Hi Andriy
    Just came across wheezy and the performance looks exceptional. Couple of questions:

    a. For development/test, wheezy would be ideal. But, what about in production use wrt both the application server and web server?

    b. Does wheezy support gevent?

    1. Thank you for the questions:
      a. Works fine with uwsgi+cpython2.7 or gunicorn+pypy behind nginx; memcached for content caching.
      b. If your application server supports gevent you should be good with wheezy.web as well.

  3. Hi,
    I have a problem in the tutorial.
    from wheezy.template.engine import Engine
    ImportError: No module named template.engine
    but I have installed wheezy.template in my venv with easy_install

    1. The import error as you reported happens if you do import like this:
      from template.engine import Engine
      Ensure valid import in your code, please.

    2. Turns out wheezy.template wasn't installed correctly (I used "easy_install wheezy.template"). I removed the package and installed with "pip install wheezy.template". That did it.

  4. Andriy,
    is there a community place, like google groups, for wheezy? I think a communication channel like that would open things up a bit. A place to ask questions, give examples etc.

    I like the wheezy tutorial, it's understandable.

    1. Hi,
      I figured this might be useful, so I opened!forum/wheezyweb