MNML - An ultra-minimal Python web framework
After growing out of the extensive feature set and perceived bloat of Django, and inspired by the new wave of super-tiny Python WSGI/Web frameworks such as Juno, Web.py, and Newf, I thought it a good exercise to write my own. MNML only includes features I feel are useful (if you disagree with the batteries I include you're free to use another framework).
MNML's core philosophy is that I really love writing Python and want to do that for most things, but I also want a certain level of "plumbing" taken care of for me. In addition, MNML:
- Is strictly WSGI;
- Provides URL mapping to HTTP response relationship, aka routing;
- Provides methods for all HTTP method verbs (
- Provides named route matching for URLs with the ability to reverse said URLs (like Django's
- Provides the ability to add middleware functions so one can alter the request or response as required;
- Does not dictate the template or ORM layer you should use--MNML is strictly about URL routing and serving, and tools needed to do so; and mostly
- Lets the implementer write Python, not a sub-set of Python.
Finally, MNML will be covered by extensive unit tests!
- Unit tests;
- URL reversing;
- Shortcuts for redirects, gone, 404 etc;
- Support for middleware (required for sessions at the least);
web.pystyle method routing:
class MyRoute(object): def GET(self, request): pass def POST(self, request): pass;
- More unit tests;
- Production WSGI interface for Apache etc.
- SCGI support so Google App Engine can run it;
- De-couple routes from system so people can roll their own (using
/resource/:arg/, for example);
- Response middleware to doctor the response.