From 34698032275b6d7274465b1f534378527b62e450 Mon Sep 17 00:00:00 2001
From: Jacek Lebioda <jacek.lebioda.001@student.uni.lu>
Date: Wed, 16 Nov 2016 13:18:30 +0100
Subject: [PATCH] Complete installation guide in readme

---
 readme.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/readme.md b/readme.md
index 52d05244..ba904092 100644
--- a/readme.md
+++ b/readme.md
@@ -2,11 +2,53 @@
 
 ## Required software (on ubuntu's OS family):
   - `sudo apt-get install libpq-dev python-dev postgresql postgresql-contrib python virtualenv python-virtualenv`
-  - After cloning the repository: `. env/bin/activate; pip install -r requirements.txt`
 
-## Development
-    
-    - Always start by activating _virtualenv_, by: `devel@host ~/home/smash $ . env/bin/activate`
+## Postgres installation
+  - If you don't have postgres installed, complete step seven from [https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn) (remember to save all the credentials, they will be necessary to run the application).
 
+## Developer project installation
+  - `mkdir -p ~/dev/smash`
+  - `cd ~/dev/smash`
+  - `git clone ssh://git@git-r3lab-server.uni.lu:8022/piotr.atyjaszyk/scheduling-system.git`
+  - `cd scheduling-system`
+  - `virtualenv env` to create new virtualenv (contains clean python working environment)
+  - `. env/bin/activate` (to start using virtualenv)
+  - `pip install -r requirements.txt` to install project's dependencies
+  - Create `local_settings.py` file in `/scheduling-system/smash/web` directory, containing:
+
+```
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'Paste long random string here' # Insert long random string
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+WSGI_APPLICATION = 'smash.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',
+        'NAME': 'smashdb', # Insert your database's name
+        'USER': 'postgresmashuser', # Insert your database's user
+        'PASSWORD': 'thePOSTGRESpassword', # Insert your user's password
+        'HOST': 'localhost',
+        'PORT': '' # '' === default one # Empty string is OK
+
+        # If to use sqlite
+        # 'ENGINE': 'django.db.backends.sqlite3',
+        # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+    }
+}
+
+STATIC_ROOT = '/tmp/static'
+```
+
+## Development    
+  - Remember, that before working you have to activate _virtualenv_, by: `devel@host ~/home/smash/scheduling-system $ . env/bin/activate`
+  - In order to run development server, run: `devel@host ~/home/smash/scheduling-system/smash $ ./manage.py runserver` and go to `127.0.0.1:8000` in browser
 
 
-- 
GitLab