Skip to content

Installation and Setup Instructions

Jayesh Lahori edited this page Apr 23, 2015 · 15 revisions

Following are step-wise installation instructions for setting up AdminUnit app.

Note : Tested on Ubuntu 13.04

Install pip

For all python package installation I've used pip. It can be installed by following command

sudo apt-get install python-pip

Install Django

sudo pip install Django==1.6.5

Also, there is a dependency for google-charts Django app for reporting feature. This can be installed by

sudo pip install django-google-charts
sudo pip install django-qsstats-magic
sudo pip install python-dateutil

Install PostgreSQL

For Database, I've used PostgreSQL. To install postgreSQL perform the following steps. These have been adapted from Irish Medina

$> sudo apt-get install postgresql
$> sudo apt-get install python-psycopg2
$> sudo -u postgres psql
postgres=> create role myuser with createrole createdb login password 'mypassword';
postgres=> \q
$> sudo vim /etc/postgresql/x.x/main/pg_hba.conf
Change the line `local all postgres peer` to `local all postgres md5`
Change the line `local all all peer` to `local all all md5`
$> sudo service postgresql restart
$> createdb -U myuser vms;

Clone Project

If you don't already have git, install it by running the following command:

sudo apt-get install git

Clone project by executing:

git clone https://github.com/jayesh92/vms-1.git

Setup Django Models

In VMS Project root dir, execute the following command

python manage.py syncdb

When asked for super-user cretaion, enter yes and remember the details. This is the super-user of AdminUnit app.

Change configs

Add email gateway settings to VMS/settings.py. Current example includes for gmail but Username and password needs to be included.

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587 
EMAIL_HOST_USER = 'ADMIN EMAIL'
EMAIL_HOST_PASSWORD = 'PASSWORD'

Testing

To run unit-tests, execute the command in VMS project root directory

python manage.py test

End Result must be OK

Run Server

To run the app, execute (in VMS Project root dir)

python manage.py runserver

Point your browser to 127.0.0.1:8000/AdminUnit or if it is a server, check the IP by ifconfig and point to IP:8000