RuralIndia / pari

Sainath's People's Archive Of Rural India
BSD 3-Clause "New" or "Revised" License
22 stars 9 forks source link

Pari

People's Archive Of Rural India

Build Status

This repo has been deprecated in favour of the new one at https://github.com/PARINetwork/pari

Dev Setup

Clone the repo.

Init the Tiny MCE submodule:

git submodule update --init

Python and packages management

Use pyenv for python runtime and packages management. Also install the pyenv-virtualenv plugin to handle virtualenv as well.

cd pari
pyenv install 2.7.6
pyenv virtualenv pari

Install the dependencies

We need LESS compiler to be in PATH to get LESS files compiled into CSS. If you don't have node.js and npm installed already then do,

brew install node
curl https://npmjs.org/install.sh | sh

and then,

npm install -g less

Also we need libjpeg and freetype for image processing

brew install libjpeg
brew install freetype

CD into the repo and install the python dependencies(make sure you are on the 'pari' virtual-env)

pip install -r requirements/dev.txt

Note:Use autoenv to simplify environment management. The checked-in .env file will install sets the DJANGO_SETTINGS_MODULE environment variable to pari.settings.dev for local development.

Setup the database

We use Postgres for development and production.

For development purposes, create a Postgres database with name pari. The user needs to be pari, with password pari.

createdb pari
createuser -srP pari

To setup data, run the following:

python manage.py syncdb 
python manage.py migrate
python manage.py loaddata pari/fixtures/initial_data_1.json 

Note: Add these to your .bash_profile if you are getting "unknown locale: UTF-8" error

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Start the Server

python manage.py runserver

Functional tests

Functional tests are written using selenium(webdriver) with py.test as test runner.

To execute tests, do build.sh functional or just py.test at project root dir.