Collect, Analyze and Share
Switch branches/tags
Clone or download
Failed to load latest commit information.
docker Python 3 and 2 docker-compose files Jul 17, 2018
docs Fix email verification documentation Aug 24, 2018
extras Move postgres Dockerfile to onaio/docker-builds Jan 23, 2017
onadata Update changelog - v1.15.0 Oct 10, 2018
requirements Update S3 requirements to use boto3 Sep 2, 2018
script Fix spelling mistakes in configs May 14, 2018
.bowerrc moved js text directory to libs directory Jan 12, 2014
.gitattributes OS specific lineendings Feb 21, 2013
.gitignore Docker: update Jun 20, 2018
.isort.cfg Sort imports Apr 17, 2018
.jshintrc disable nomen to allow underscores in private var names Jan 9, 2014
.mailmap PLD: batch update docs and osm May 7, 2015
.pylintrc Code cleanup with pylint Aug 26, 2017
.style.yapf add yapf style config for this repository Jul 24, 2017
.travis.yml Upgrade to latest packages with Django < 2.0 Jul 12, 2018
CHANGES.rst Update changelog - v1.15.0 Oct 10, 2018
Dockerfile Python 3 and 2 docker-compose files Jul 17, 2018
Dockerfile.py2 Python 3 and 2 docker-compose files Jul 17, 2018
LICENSE Update license to be ongoing Jul 28, 2017
Makefile Fix spelling mistakes in configs May 14, 2018
README.rst Acknowledge Danish Tariq's Security Contribution May 3, 2018
bower.json LW: upgraded backgrid to 0.3.5 Feb 14, 2014
docker-compose-py2.yml Python 3 and 2 docker-compose files Jul 17, 2018
docker-compose.yml Python 3 and 2 docker-compose files Jul 17, 2018 use common settings as default to prevent local_settings from being o… Jan 23, 2014
package.json PLD: try to pin bower version Jul 11, 2014 Use django orm for celery result backend Aug 8, 2018
uwsgi.ini Minimal working uwsgi.ini May 14, 2018


Ona Platform

Collect, Analyze and Share Data!


Ona is derived from the excellent formhub platform developed by the Sustainable Engineering Lab at Columbia University.


See the installation documentation.


Install Docker and Docker Compose.

docker-compose up

# create super user
# -----------------
docker exec -it onadata_web_1 bash

# activate virtual envirenment
source /srv/.virtualenv/bin/activate

python createsuperuser

It should be accessible via http://localhost:8000. The settings are in onadata/settings/

On registration check the console for the activation links, the default email backend is django.core.mail.backends.console.EmailBackend. See Django Docs for details.


If you would like to contribute code please read Contributing Code to Ona Data.

Edit top level requirements in the file requirements/ Use
pip-compile to update requirements/base.pip. You will need to update requirements.pip and set lxml==3.6.0, for some unknown reason pip-compile seems to pick a lower version of lxml when openpyxl requires lxml>=3.3.4.
pip-compile --output-file requirements/base.pip requirements/

Security Acknowledgments

We would like to thank the following security researchers for responsibly disclosing security issues:

Name Date Severity Contribution
Danish Tariq 1st April 2018 Medium Users able to create projects in other user accounts

Code Structure

  • api - This app provides the API functionality mostly made up of viewsets
  • logger - This app serves XForms to and receives submissions from ODK Collect and Enketo.
  • viewer - This app provides a csv and xls export of the data stored in logger. This app uses a data dictionary as produced by pyxform. It also provides a map and single survey view.
  • main - This app is the glue that brings logger and viewer together.


To generate a locale from scratch (ex. Spanish) makemessages -l es -e py,html,email,txt ;
for app in {main,viewer} ; do cd onadata/apps/${app} && makemessages -d djangojs -l es && cd - ; done

To update PO files makemessages -a ;
for app in {main,viewer} ; do cd onadata/apps/${app} && makemessages -d djangojs -a && cd - ; done

To compile MO files and update live translations compilemessages ;
for app in {main,viewer} ; do cd onadata/apps/${app} && compilemessages && cd - ; done

Api Documentation

Generate the API documentation and serve via Django using:

cd docs
make html
python collectstatic

Generate sphinx docs for new code using autodoc.

Run sphinx in autobuild mode using:

sphinx-autobuild docs docs/_build/html

Requires sphinx-autobuild, install with pip install sphinx-autobuild.

Django Debug Toolbar

  • $ pip install django-debug-toolbar
  • Use/see onadata/settings/debug_toolbar_settings/py
  • Access api endpoint on the browser and use .debug as the format extension e.g /api/v1/projects.debug

Upgrading existing installation to django 1.9+


  • Postgres 9.4 or higher
  • xcode-select version 2343 or higher

Upgrading from a pervious Ona setup Ensure you upgrade all your pip requirements using the following command:

pip install -r requirements/base.pip

Fake initial migration of guardian, django_digest, registration. Migrate contenttypes app first.

python migrate contenttypes
python migrate --fake-initial django_digest
python migrate --fake-initial guardian
python migrate --fake-initial registration
python migrate

Major django changes affecting Ona * The DATABASES settings key depricates the use of the autocommit setting in the OPTIONS dictionary.