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
- 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.
- 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 are provided, then the importable mechanism takes precedence.