Project

General

Profile

ModjyLocateCallables » History » Version 4

Alan Kennedy, 2011-02-25 09:16 PM
Gramer misteak.

1 1 Alan Kennedy
h1. Writing applications with modjy.
2
3
h2(#locating_callables). How modjy locates application callable objects.
4
5
According to the "WSGI specification":http://www.python.org/dev/peps/pep-0333/, all WSGI applications must be python callable objects, taking a defined parameter list. Application callables can be python "functions":http://docs.python.org/ref/function.html, class instances with a "__call__()":http://docs.python.org/ref/callable-types.html method, or indeed "any callable object":http://docs.python.org/ref/calls.html.
6
7
There are two different mechanisms by which you can specify application callable objects to modjy. They are
8
9
10 3 Alan Kennedy
 # 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 [[ModjyAppImportable|importing applications page]].
11
 # 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 [[ModjyAppExecFile|execfile page]]
12 1 Alan Kennedy
13 4 Alan Kennedy
If configuration values for both of these mechanisms are provided, then the [[ModjyAppImportable|importable mechanism]] takes precedence.