diff options
-rw-r--r-- | INSTALL | 76 | ||||
-rwxr-xr-x | django/setup.py | 2 | ||||
-rw-r--r-- | django_nginx.conf | 8 |
3 files changed, 72 insertions, 14 deletions
@@ -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 diff --git a/django/setup.py b/django/setup.py index 5d0c7da..f85c6b1 100755 --- a/django/setup.py +++ b/django/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='talerbank', - version='0.2', + version='0.0', description='Taler friendy bank', url='git://taler.net/bank', author='Marcello Stanisci', diff --git a/django_nginx.conf b/django_nginx.conf index 8dc1142..4544e31 100644 --- a/django_nginx.conf +++ b/django_nginx.conf @@ -14,14 +14,6 @@ server { server_name localdjango; # substitute your machine's IP address or FQDN charset utf-8; - # max upload size - client_max_body_size 75M; # adjust to taste - - location /static { - alias /home/marcello/static_test/statix; - } - - # Finally, send all non-media requests to the Django server. location / { uwsgi_pass django; include /home/marcello/static_test/uwsgi_params; |