summaryrefslogtreecommitdiff
path: root/INSTALL
blob: ff32106efa629dfa286afb8fb0d97a762db09295 (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
56
57
58
59
60
61
62
63
64
65
66
================== 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

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 must be
initialized. Give the following two commands (respecting the
sequence):

$ python manage.py makemigrations
$ python manage.py migrate

The following command is also needed, in order to create some predefined
accounts:

$ python manage.py pre_account

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