blob: ec36082893b54c451aa0a91c5a07f071ec85d7c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
Paste Example Application: todo
=================================
This is a simple application intended to demonstrate the basic usage of
a Paste site as well as some WSGI features such as a middleware hooks
that performs URL rewriting.
ROADMAP lists some of the features we intend to implement in the future.
Installing Paste
------------------
`docs/Paste.txt`__ describes a basic user-level installation of
Paste and supported WSGI servers.
.. __: http://svn.w4py.org/Paste/trunk/docs/Paste.txt
Your First Run
--------------
The commands::
cd Paste/trunk
scripts/wsgi-server --server=wsgiutils --webkit-dir=example/todo \
--port 8080 -D --data-dir='/var/www/data1'
If you do not have $PYTHONPATH set up as described Paste.txt then you
can add a like such as this::
env PYTHONPATH=`pwd` paste/server.py ...
Replace 'env' with 'setenv' if you're using csh or tcsh.
Then open up http://localhost:8080/
Running Multiple Instances
--------------------------
Any options not defined in server.py are passed on to the application.
In the previous example --data-dir is an optional argument that
specifies where to put the todo list, which is a pickled instance of the
Manager class in model.py.
Simply specify an alternate --port and --data-dir to run multiple
instances simultaneously. The todo lists are saved to disk after each
modification to user accounts or lists and saved as state.pickle.
Testing
-------
There is a simple set of tests in examples/todo/tests that you can run
using py.test (see `PyPy doc`__ for information on how to set up py.test).
The tests only cover the logic contained in todo/model.py
.. __: http://codespeak.net/pypy/index.cgi?doc/howtopypy.html
|