summaryrefslogtreecommitdiff
path: root/INSTALL
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-03-14 15:18:37 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-03-14 15:18:37 +0100
commit02c0ed8399e0b9c99750bfe5b7eb75c6253e466f (patch)
tree3cdbddea986892f9449e075ddcb16a1f315be6dc /INSTALL
parent98506829525ba31778844ba09a92b26b948a0c3f (diff)
downloadbank-02c0ed8399e0b9c99750bfe5b7eb75c6253e466f.tar.gz
bank-02c0ed8399e0b9c99750bfe5b7eb75c6253e466f.tar.bz2
bank-02c0ed8399e0b9c99750bfe5b7eb75c6253e466f.zip
adding INSTALL instructions for a more pythonic way of doing
Diffstat (limited to 'INSTALL')
-rw-r--r--INSTALL76
1 files changed, 71 insertions, 5 deletions
diff --git a/INSTALL b/INSTALL
index 3e89709..070ac5f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -56,16 +56,82 @@ $ python manage.py runserver 127.0.0.1:8080
The bank's homepage is now available at http://127.0.0.1:8080/auth/
+
+------------------ 1.a The (more) Pythonic way -----------------
+
+This walkthrough is supposed to run with Python 3.4. and to use Postgres
+as database backend
+
+Make sure your system has 'virtualenv' and 'pip' installed.
+For example, on Debian systems, run:
+
+# apt-get install virtualenv python3-pip python3.4-dev postgresql
+
+Before delving into bank's installation, create a database called
+'talertest' owned by the user running the bank.
+
+Next, create an environment which will "host" the bank's dependencies:
+
+$ virtualenv -p python3 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.
+
+The following step installs the bank as a "package" via setuptools
+
+$ cd django/
+$ python setup.py install
+
+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
+
+Please refer to section 3 in case the bank needs to be accessed via nginx
+NOTE: running the bank via nginx is encouraged in order to make SSI commands
+work
+
--------------------- 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.
+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
+
+$ ./django_wsgi.sh /path/to/bank_env
+The nginx configuration is based on the guide in [1]
[1] http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html