1 NOTE: The following examples do not currently work with Django: Auth, Calendar.
2
3 WebStack supports Django in the sense that WebStack applications can be
4 deployed within Django instances according to the guidelines described in the
5 Django documentation plus a few caveats. Here is the basic process:
6
7 1. Create a Django instance or find an existing instance to use.
8 2. Create or find an application where WebStack resources and applications
9 shall be deployed.
10 3. Add URL mappings to the instance's urls.py file - see below for a
11 description of how this should be done.
12 4. Add WebStack handlers to the application directory.
13
14 URL mappings
15 ------------
16
17 The docs/Django/urls.py file contains definitions for the example applications
18 based on a Django instance called "djangoinstance" (in a directory of that
19 name) and the "webstack" application (in a directory of that name within the
20 instance). The urls.py file employs URL patterns to direct requests to each of
21 the examples.
22
23 Consider the auth example - the following pattern is employed to detect
24 requests intended for it:
25
26 ^django/webstack/auth(?P<vp>/.*)?
27
28 Here, the example will be accessible via a URL like this:
29
30 http://localhost/django/webstack/auth
31
32 Additional path information is captured by a special named regular expression
33 group which is used within the WebStack adapter.
34
35 WebStack handlers and adapters
36 ------------------------------
37
38 The handlers from examples/Django should be copied into or otherwise linked to
39 from the "webstack" application directory within the Django instance. Each
40 handler should contain a function, produced by calling the special deploy
41 function from the Django adapter, with a name as stated in the urls.py file.
42
43 Consider the auth example - the following path to the resource is stated:
44
45 djangoinstance.webstack.authapp.auth
46
47 Here, within the instance and application, the "authapp" handler (provided by
48 the authapp.py from examples/Django) must contain a function called "auth".