diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-12-16 17:10:16 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-12-16 17:10:16 +0100 |
commit | 46c4ebb018bc18f6745d1a6305737b70a15b0a0c (patch) | |
tree | 495a59274dd5e8bdd8b1f35302d4964678e8ca54 /README | |
parent | 6da87a88a497173738c5d01797b95003c59d2689 (diff) | |
download | bank-46c4ebb018bc18f6745d1a6305737b70a15b0a0c.tar.gz bank-46c4ebb018bc18f6745d1a6305737b70a15b0a0c.tar.bz2 bank-46c4ebb018bc18f6745d1a6305737b70a15b0a0c.zip |
40% install/config instructions
Diffstat (limited to 'README')
-rw-r--r-- | README | 164 |
1 files changed, 17 insertions, 147 deletions
@@ -2,163 +2,33 @@ This code implements a bank Web portal that tightly integrates with the Taler payment system. The bank it primarily meant be used as part of a demonstrator for the Taler system. -================== HOW INSTALL THE PYTHON BANK ================= +================== HOW TO INSTALL THE PYTHON BANK ================= -----------------------------0 Preface -------------------------- +From the repository's top directory, run -In order to get the complete bank's codebase, a submodule needs to be -pulled. To do this, run: +$ ./bootstrap -$ git submodule update --init +this operation will fetch additional libraries needed by the +bank (mostly JavaScript includes), and create the configure script. -(This submodule carries some HTML/JS code which is reused among all -Taler's Web components.) +The next step is to specify the install prefix, run -As for the database backend, the bank uses PostgreSQL and needs a -database called 'talertest' in it, owned by the user which launches -the bank. To grant access to Postgres 9.x, run: +$ ./configure --prefix=$HOME/local # Adapt to your needs. -$ su # give root password -# su - postgres -$ createuser -d $TALER_BANK_USER +Then the usual GNU-compatible commands, that are -where $TALER_BANK_USER is the username of the user who will run the -bank. - -For Postgres 8.x, the last step needs to be changed to just: - -$ createuser - -then enter the username interactively. When asked, do not set it to -superuser, but allow the creation of databases, and do not allow the -creation of new roles. - - -After this, you can follow two styles of installation, the Pythonic -way or the GNU way. The Pythonic way is recommended for development, -while the GNU way is recommended for actual deployment. - - ----------------------1 The Pythonic way ------------------------ - -Make sure your system has 'virtualenv' and 'pip' installed. -For example, on Debian systems, run: - -# apt-get install virtualenv python3-pip python3.4-dev - -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 django/ - -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 - - ---------------------- 2 The GNU way ---------------------------- - -The installation is done by the usual - -$ ./bootstrap.sh -$ ./configure $ make -$ make install - -sequence. Note that you cannot skip 'make'. For './configure', -you can pass a few options: - -(*) The '--prefix' option will point a directory which hosts both the -virtualenv data and the bank's website itself. - -(*) The '--exec-prefix' option will point to a directory which will -host the executables (i.e. a shell scripts which launch the Web -services), so it should probably be somewhere within $PATH. - - -To complete the setup, you need to initialize the database: - -0) a DB called 'talertest' must exist, with the user running the bank -owning it; try: - -$ taler-bank-manage --createdb -It should either report that the database 'talertest' exists, or -create it. If neither works, please re-read the preface on top -of this file. +and -1) After the database has been created, some tables must be created: - -$ taler-bank-manage --definetables - -2) Optionally, if the bank is to be used in the demo setup, we - predefine certain public accounts: - -$ taler-bank-manage --preaccounts - -3) Optionally, to populate the DB with sample transaction data (i.e. - to check how some pages are rendered once data is present), issue: - -$ taler-bank-manage --sampledata - -4a) To quickly run the bank as an HTTP server without nginx and -without the SSI on port 8080, run: - -$ taler-bank-manage --bareserver 8080 - -4b) In production, the bank should be run with: - -$ taler-bank-wsgi - -Please note that the bank works properly only via nginx since it uses -SSI and the above runs the WSGI protocol, not HTTP! This is described -in the next section. - - ------------------ 3 How to bind Django and nginx --------------- +$ make install -The basic statements needed to run the bank via nginx are shown in -'django_nginx.conf'. Once those statements have been applied, assuming -your CWD is still 'django/', the bank is run with +================== HOW TO CONFIGURE THE PYTHON BANK ================= -$ ./django_wsgi.sh /path/to/bank_env +In order to properly run, the bank needs the following parts to be configured -The nginx configuration is based on the guide in [1] -[1] http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html +* Database name: connection string for the database to be used, currently Postgres. +* Serving: whether we want the bank accessible via TCP or unix domain sockets. +* Fractional precision: precision of the fractional part of Taler objects. +* Fractional length: how many digits after the floating point we want to be shown + in HTML pages. |