Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A lightweight Python web framework

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.textile
Octocat-spinner-32 __init__.py
Octocat-spinner-32 example_app.py
Octocat-spinner-32 mnml.py
Octocat-spinner-32 runtests.py
README.textile

MNML WSGI Web Framework

A small python glue framework for building web applications and services that
run atop WSGI compliant servers. The emphasis is on HTTP best practices,
readable code and allowing applications to be built using whatever
other python modules you like.

MNML’s core philosophy is that we really love writing Python and want to do that for most things, but I also want a certain level of “plumbing” taken care of. In addition, MNML:

  • Is strictly WSGI;
  • Provides URL mapping to HTTP response relationship, aka routing;
  • Provides methods for all HTTP method verbs (PUT and DELETE are supported);
  • 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.

Hello World

from mnml import RegexBasedApplication, RequestHandler, HttpResponse, development_server

class HelloWorld(RequestHandler):
    def GET(self):
        return HttpResponse("<h1>Hello World</h1>")
        
routes = (
    (r'^/$', HelloWorld),
)
application = RegexBasedApplication(routes)

if __name__ == '__main__':
    development_server(application)

Credits

Original version of MNML by Bradley Wright (intranation.com) with further work by Gareth Rushgrove (morethanseven.net).

MNML has borrowed fairly heavily from newf, since that’s
basically the bare minimum code required for a routed WSGI framework. Webapp, the framework included with the Google App Engine SDK, has also provided inspiration and code.

Something went wrong with that request. Please try again.