1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/Django/NOTES.txt Sun Jan 15 23:21:34 2006 +0000
1.3 @@ -0,0 +1,48 @@
1.4 +NOTE: The following examples do not currently work with Django: Auth, Calendar.
1.5 +
1.6 +WebStack supports Django in the sense that WebStack applications can be
1.7 +deployed within Django instances according to the guidelines described in the
1.8 +Django documentation plus a few caveats. Here is the basic process:
1.9 +
1.10 + 1. Create a Django instance or find an existing instance to use.
1.11 + 2. Create or find an application where WebStack resources and applications
1.12 + shall be deployed.
1.13 + 3. Add URL mappings to the instance's urls.py file - see below for a
1.14 + description of how this should be done.
1.15 + 4. Add WebStack handlers to the application directory.
1.16 +
1.17 +URL mappings
1.18 +------------
1.19 +
1.20 +The docs/Django/urls.py file contains definitions for the example applications
1.21 +based on a Django instance called "djangoinstance" (in a directory of that
1.22 +name) and the "webstack" application (in a directory of that name within the
1.23 +instance). The urls.py file employs URL patterns to direct requests to each of
1.24 +the examples.
1.25 +
1.26 +Consider the auth example - the following pattern is employed to detect
1.27 +requests intended for it:
1.28 +
1.29 +^django/webstack/auth(?P<vp>/.*)?
1.30 +
1.31 +Here, the example will be accessible via a URL like this:
1.32 +
1.33 +http://localhost/django/webstack/auth
1.34 +
1.35 +Additional path information is captured by a special named regular expression
1.36 +group which is used within the WebStack adapter.
1.37 +
1.38 +WebStack handlers and adapters
1.39 +------------------------------
1.40 +
1.41 +The handlers from examples/Django should be copied into or otherwise linked to
1.42 +from the "webstack" application directory within the Django instance. Each
1.43 +handler should contain a function, produced by calling the special deploy
1.44 +function from the Django adapter, with a name as stated in the urls.py file.
1.45 +
1.46 +Consider the auth example - the following path to the resource is stated:
1.47 +
1.48 +djangoinstance.webstack.authapp.auth
1.49 +
1.50 +Here, within the instance and application, the "authapp" handler (provided by
1.51 +the authapp.py from examples/Django) must contain a function called "auth".