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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
================== HOW RUN THE PYTHON BANK =====================
---------------------1 The Pythonic way ------------------------
Make sure your system has 'virtualenv' and 'pip' installed.
For example, on Debian systems, run:
# apt-get install virtualenv python-pip python-dev
Currently, the bank runs on Python 2.7.
Next, create an environment which will "host" the bank's dependencies:
$ virtualenv bank_env
This should create a directory named 'bank_env/' in your current
working directory.
That directory will contain all the Pythonic dependencies of the bank.
To activate your environment in the current shell, use:
$ source bank_env/bin/activate
(To later deactivate it, you can simply close the shell.)
Inside the "activated" shell, install the dependencies:
$ pip install -r requirements.txt
The file 'requirements.txt' is contained in this folder.
Once the environment is set up, the bank can be launched. For that
purpose, you need to first
$ cd TalerBank/
Before actually launching the bank, the bank's database and static files'
serving must be initialized. Give the following commands (respecting the
sequence):
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py collectstatic --noinput
The following command is also needed, in order to create some predefined
accounts:
$ python manage.py pre_accounts
In order to add sample donations to predefined account:
$ python manage.py sample_donations
If everything has worked fine, launch the bank's web server with:
$ python manage.py runserver 127.0.0.1:8080
The bank's homepage is now available at http://127.0.0.1:8080/auth/
--------------------- 2 The GNU way ----------------------------
TBD.
----------------- 3 How to bind Django and nginx ---------------
Once the system is set up as described in 1, see 'django_nginx.conf'
to make the bank accessible via Nginx. The link in [1] gives a
complete walkthrough of the task. Assuming that the bank is correctly
accessible via Nginx, the script 'django_wsgi.sh' will take care of
activating the right environment and launching the server.
[1] http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
|