What's a good lightweight Python MVC framework? [closed] What's a good lightweight Python MVC framework? [closed] python python

What's a good lightweight Python MVC framework? [closed]


web2py is 265Kbytes of source code and 1.2MB all inclusive (compare with 4.6MB of Django). Yet web2py will do everything you need (manage session, cookies, request, response, cache, internationalization, errors/tickets, database abstraction for GAE, SQLite, MSSQL, MySQL, Postgres, Oracle, FireBird, etc.) It does not need installation - just unzip and click on it - and you can do development in your browser.

Web2py has both routes and reverse routes.

Web2py has a hierarchical template systems which means a view can extend a layout which can extend another layout, etc. views can also include other views.


Since you explicitly don't want an ORM, I'd stay away from a "full stack" framework if I were you. Python's WSGI standard gives you a ton of easy-to-use options that will give you just the features you need and even let you choose your style of working.

Here's an example: for URL dispatch you can use Routes, which ports over the URL dispatch style of Rails. Or you could combine Selector with WebOb if that style suits you more.

For "layouts", you can use the powerful Jinja2 if you want templates that cannot run code. Or, Mako if you prefer to be able to mix a little code in with your templates. You can even use Deliverance to control the layout of pages that are composed from multiple apps and even multiple languages!

A full-stack web framework is nice in that it makes a bunch of choices for you, letting you pay attention just to the app your building. But, the choices I've listed above are a good collection to get you going building your own. If you head down that path, you'll find it easy to plug in Beaker for caching and sessions if you need them, or WebError to help you with debugging.

Personally, I'm a big fan of ORMs (particularly SQLAlchemy), but if you're looking to go ORM free and lightweight overall you can't beat combining the great WSGI components available in Python.


Give web.py a try. It's very simple and may provide the minimalism that you are looking for.