Skip to content
Indigo Platform for publishing beautiful legislation.
JavaScript Python CSS HTML XSLT Ruby
Branch: master
Clone or download
Latest commit db50151 Aug 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Compile scss Apr 15, 2018
celery Fake celery so that pinax-badges is happy. Jul 3, 2019
docs Lookup tabs using place settings Aug 15, 2019
indigo FIX diffing a list that has emptied Aug 19, 2019
indigo_api Merge branch 'master' into taxonomy-content-api Aug 19, 2019
indigo_app Cheatsheet Aug 20, 2019
indigo_content_api taxonomy tests pass Jul 25, 2019
indigo_metrics add taxonomies to all tests that use work fixture Jul 23, 2019
indigo_resolver resolver handles /akn May 9, 2019
indigo_social Badge natures Aug 20, 2019
indigo_za add taxonomies to all tests that use work fixture Jul 23, 2019
.bowerrc Ace 1.1.8 Mar 11, 2015
.coveragerc Coverage and coveralls Jun 11, 2018
.gitignore Remove some unnecessary changes May 17, 2019
.travis.yml ruby 2.6.2 in travis Mar 29, 2019
Gemfile Updated Slaw and BODY marker. fixes #553 Jun 4, 2019
Gemfile.lock Updated Slaw and BODY marker. fixes #553 Jun 4, 2019
LICENSE LICENSE file Jan 12, 2015
MANIFEST.in Move locale files into indigo/locale so dependent packages find them Jul 11, 2019
README.md Crowdin link Jul 16, 2019
VERSION First pass at pip distribution Jul 29, 2018
bower.json Showdown Jun 2, 2017
crowdin.yml Update crowdin.yml Jul 11, 2019
manage.py Initial commit Jan 12, 2015
package-lock.json indigo-web 3.4.0 Jul 16, 2019
package.json indigo-web 3.4.0 Jul 16, 2019
setup.cfg First pass at pip distribution Jul 29, 2018
setup.py Don't install newer django-cors-headers Aug 16, 2019

README.md

Indigo

Codacy Badge Build Status Coverage Status

Indigo logo

Indigo is AfricanLII's document management system for managing, capturing and publishing legislation in the Akoma Ntoso format.

It is a Django python web application using:

Read the full documentation at indigo.readthedocs.io.

Local development

Clone the repo:

git clone https://github.com/laws-africa/indigo.git
cd indigo

Ensure you have python 2.7, virtualenv and pip installed.

Create and activate a virtualenv and install dependencies:

virtualenv env --no-site-packages
source env/bin/activate
pip install -e '.[test]'

Ensure you have PostgreSQL installed and running. Create a postgresql user with username and password indigo, and create a corresponding database called indigo.

sudo su - postgres -c 'createuser -d -P indigo'
sudo su - postgres -c 'createdb indigo'

Check that you can connect to the postgresql database as your regular shell user (not indigo user) by means of password authentication:

psql -h localhost indigo indigo

If you can't connect, you can modify your pg_hba.conf (/etc/postgresql/9.6/main/pg_hba.conf for postgresql 9.6) to allow md5 encrypted password authentication for users on localhost by adding a line like this:

local	all		all     md5

Then run migrations to setup the initial database:

python manage.py migrate
python manage.py update_countries_plus

If you have trouble connecting to your database, you may need to change the default database settings in indigo/settings.py:

db_config = dj_database_url.config(default='postgres://indigo:indigo@localhost:5432/indigo')

Then create the superuser:

python manage.py createsuperuser

Now, run the server:

python manage.py runserver

Now login at http://localhost:8000 and create a country by going to http://localhost:8000/admin, choosing Countries under Indigo API and clicking Add Country.

Now give yourself all the permissions to work in that country by clicking on your name in the top right corner and choosing Profile. In the Badges Earned section, award yourself all the badges in the dropdown list.

Ruby and other non-Python dependencies

You won't be able to import documents yet. First, you'll need to install Ruby and the Slaw parser library. We strongly recommend installing and using RVM or a similar Ruby version manager. You'll need Ruby version 2.3.

Once you've install Ruby, install Bundler and the Indigo dependencies:

gem install bundler
bundle install

You can test that Slaw is installed with slaw --version:

$ slaw --version
slaw 1.0.0

You will also need pdftotext to import PDF files. On Mac, you can use Homebrew and run brew install poppler.

Adding translation strings

Each indigo package has its own translations in the locale directory. Translations for strings are added on CrowdIn.

If you have added or changed strings that need translating, you must tell Django to update the .po files:

for app in indigo indigo_api indigo_za; do pushd $app; django-admin makemessages -a; popd; done
django-admin compilemessages --settings indigo.settings

And then commit the changes. CrowdIn will pick up any changed strings and make them available for translation. Once they are translated, it will open a pull request to merge the changes into master.

Testing

To run the tests use:

python manage.py test

Production deployment

Read the documentation for details on deploying Indigo.

Releasing a New Version

  1. Run the tests!
  2. Update VERSION appropriately
  3. Update docs/changelog.rst
  4. Commit and push to github
  5. Release to PyPI:
python setup.py sdist bdist_wheel upload

License and Copyright

The project is licensed under a GNU GPL 3 license.

Indigo is Copyright 2015-2017 AfricanLII.

You can’t perform that action at this time.