Rapidpro Installation: Difference between revisions

From IHRIS Wiki
Line 9: Line 9:
<ul>
<ul>
<li>PostgreSQL 9.3 or later along with the PostGIS extensions. You probably want to refer to [https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/postgis/ Django’sinstallation instructions] to help get this working.</li>
<li>PostgreSQL 9.3 or later along with the PostGIS extensions. You probably want to refer to [https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/postgis/ Django’sinstallation instructions] to help get this working.</li>
<li>Redis 2.8 or later installed and listening on localhost. By default the development server uses database 15. You may install this through debian package manager (sudo apt-get install redis-server) or by downloading it on [http://redis.io/ redis website]</li>
<li>Redis 2.8 or later installed and listening on localhost. By default the development server uses database 15. You may install this through debian package manager <source lang="xml">$ sudo apt-get install redis-server</source> or by downloading it on [http://redis.io/ redis website]</li>
<li>[http://lesscss.org/ lessc], the Less compiler.</li>
<li>[http://lesscss.org/ lessc], the Less compiler.</li>
<li>[http://coffeescript.org/ coffee], the Coffee script compiler. You may also install this with  
<li>[http://coffeescript.org/ coffee], the Coffee script compiler. You may also install this with  
<source lang="xml">
<source lang="xml">
sudo apt-get install coffeescript
$ sudo apt-get install coffeescript
</source>
</source>
</li>
</li>
Line 21: Line 21:
Create Temba User For PostgreSQL
Create Temba User For PostgreSQL
<source lang="xml">
<source lang="xml">
sudo -u postgres createuser temba --superuser --pwprompt -d
$ sudo -u postgres createuser temba --superuser --pwprompt -d
sudo adduser temba
$ sudo adduser temba
</source>
</source>
</li>
</li>
Line 28: Line 28:
<source lang="xml">
<source lang="xml">
Create the database as temba user:
Create the database as temba user:
sudo -u temba psql --user=temba postgres
$ sudo -u temba psql --user=temba postgres
postgres=> create database temba;
postgres=> create database temba;
CREATE DATABASE
CREATE DATABASE
Line 35: Line 35:
Now connect as superuser that can install extensions
Now connect as superuser that can install extensions
<source lang="xml">
<source lang="xml">
sudo -u temba psql --user=temba postgres
$ sudo apt-get install postgresql-contrib-X.Y #replace X.Y with version number i.e 9.3
$ sudo -u temba psql --user=temba postgres
postgres=# \c temba
postgres=# \c temba
You are now connected to database "temba" as user "psql".
You are now connected to database "temba" as user "psql".
Line 45: Line 46:
CREATE EXTENSION
CREATE EXTENSION
</source>
</source>
</li>
<li>
Clone Rapidpro<br>
Now clone the RapidPro repository and link up the development settings:
<source lang="xml">
$ git clone git@github.com:rapidpro/rapidpro.git
$ cd rapidpro
$ ln -s temba/settings.py.dev temba/settings.py
</source>
NB:open the file temba/settings.py to make sure that it was created,if its missing or empty,do this
<source lang="xml">
$ cp temba/settings.py.dev temba/settings.py
</source>
</li>
<li><b>Build Virtual Environment</b><br>
You should always use a virtual environment to run your RapidPro installation. The pinned dependencies for RapidPro can be found in pip-freeze.txt. You can build the needed environment as follows (from the root rapidpro directory):
<source lang="xml">
$ virtualenv env
$ source env/bin/activate
(env) $ pip install -r pip-freeze.txt
</source>
</li>
<li>
<b>Sync your database</b><br>
You should now be able to run all the migrations and initialize your development server. This takes a little while on RapidPro as syncdb also creates and initializes all the user groups and permissions.
<source lang="xml">
$ python manage.py syncdb
</source>
</li>
<li>
<b>If you want to create a super user,run this command while the env is still activated</b>
<source lang="xml">
(env) $ python manage.py createsuperuser
</source>
</li>
<li>
<b>Run development server</b><br>
At this point you’ll be able to run the development server and run RapidPro. It will be available at http://localhost:8000 or you may specify a different port number if you wish to change the default port number.
<source lang="xml">
$ python manage.py runserver 0.0.0.0:8000
</source

Revision as of 10:20, 14 December 2015

Introduction and Overview

RapidPro is an Open Source platform that allows anyone to build interactive messaging systems using an easy visual interface. A video is worth a thousand words and this brief video introduction will give you an idea of what is possible.

Installation

To install Rapidpro,follow the following steps

  1. Prerequisites Installation
    • PostgreSQL 9.3 or later along with the PostGIS extensions. You probably want to refer to Django’sinstallation instructions to help get this working.
    • Redis 2.8 or later installed and listening on localhost. By default the development server uses database 15. You may install this through debian package manager <source lang="xml">$ sudo apt-get install redis-server</source> or by downloading it on redis website
    • lessc, the Less compiler.
    • coffee, the Coffee script compiler. You may also install this with <source lang="xml"> $ sudo apt-get install coffeescript </source>
  2. Create Temba User For PostgreSQL <source lang="xml"> $ sudo -u postgres createuser temba --superuser --pwprompt -d $ sudo adduser temba </source>
  3. Create temba database, add PostGIS <source lang="xml"> Create the database as temba user: $ sudo -u temba psql --user=temba postgres postgres=> create database temba; CREATE DATABASE \q </source> Now connect as superuser that can install extensions <source lang="xml"> $ sudo apt-get install postgresql-contrib-X.Y #replace X.Y with version number i.e 9.3 $ sudo -u temba psql --user=temba postgres postgres=# \c temba You are now connected to database "temba" as user "psql". temba=# create extension postgis; CREATE EXTENSION temba=# create extension postgis_topology; CREATE EXTENSION temba=# create extension hstore; CREATE EXTENSION </source>
  4. Clone Rapidpro
    Now clone the RapidPro repository and link up the development settings: <source lang="xml"> $ git clone git@github.com:rapidpro/rapidpro.git $ cd rapidpro $ ln -s temba/settings.py.dev temba/settings.py </source> NB:open the file temba/settings.py to make sure that it was created,if its missing or empty,do this <source lang="xml"> $ cp temba/settings.py.dev temba/settings.py </source>
  5. Build Virtual Environment
    You should always use a virtual environment to run your RapidPro installation. The pinned dependencies for RapidPro can be found in pip-freeze.txt. You can build the needed environment as follows (from the root rapidpro directory): <source lang="xml"> $ virtualenv env $ source env/bin/activate (env) $ pip install -r pip-freeze.txt </source>
  6. Sync your database
    You should now be able to run all the migrations and initialize your development server. This takes a little while on RapidPro as syncdb also creates and initializes all the user groups and permissions. <source lang="xml"> $ python manage.py syncdb </source>
  7. If you want to create a super user,run this command while the env is still activated <source lang="xml"> (env) $ python manage.py createsuperuser </source>
  8. Run development server
    At this point you’ll be able to run the development server and run RapidPro. It will be available at http://localhost:8000 or you may specify a different port number if you wish to change the default port number. <source lang="xml"> $ python manage.py runserver 0.0.0.0:8000 </source