ModjyLocateCallables » History » Revision 3

« Previous | Revision 3/4 (diff) | Next »
Alan Kennedy, 2009-03-16 04:22 PM

Writing applications with modjy.

How modjy locates application callable objects.

According to the WSGI specification, all WSGI applications must be python callable objects, taking a defined parameter list. Application callables can be python functions, class instances with a __call__() method, or indeed any callable object.

There are two different mechanisms by which you can specify application callable objects to modjy. They are

  1. By specifying a single importable name. This requires specifying the name fully-package-qualified name of an importable WSGI handler, e.g. some_framework.web.handlers.WSGIHandler. This is the preferred mechanism, and takes precedence over the other mechanism, if configuration values are provided for both import mechanisms. To read more about this mechanism, see the importing applications page.
  2. By specifying a combination of three names, a directory name, a file name, and a callable name. To read more about this mechanism, see the execfile page

If configuration values for both of these mechanisms is provided, then the importable mechanism takes precedence.

Updated by Alan Kennedy over 15 years ago · 3 revisions