Skip to content

onaio/tally-ho

Folders and files

NameName
Last commit message
Last commit date
Aug 6, 2024
Nov 19, 2018
Nov 17, 2018
Nov 15, 2018
Nov 4, 2024
Nov 16, 2024
Aug 6, 2024
Jul 31, 2023
Nov 16, 2024
Oct 24, 2024
May 2, 2023
May 2, 2023
Apr 28, 2023
Mar 27, 2020
Sep 10, 2018
Nov 5, 2024
May 2, 2023
Nov 9, 2020
Apr 28, 2023
Oct 4, 2023
Apr 15, 2014

Repository files navigation

Tally-Ho

Build Status codecov Codacy Badge

Overview

Election results data entry and verification software built by Ona Systems, commissioned by the Libyan High National Elections Commission and UNDP.

Quick Install

Checkout the Repository

git clone git@github.com:onaio/tally-ho.git

Set Up Virtual Environment and Install Requirements

Prerequisites: Ensure virtualenvwrapper and PostgreSQL are installed.

mkvirtualenv tally --python=python3.9
pip install -r requirements/dev.pip

Install libpq-dev for PostgreSQL headers:

sudo apt-get install libpq-dev

Install memcached and Redis:

sudo apt-get update && sudo apt-get install -y memcached redis-server

Ensure latest versions of pip, wheel, and setuptools:

python -m pip install -U pip wheel setuptools

Enable pre-commit hook checks:

pre-commit install

Running Celery

celery -A tally_ho.celeryapp worker --loglevel=info

Quick Start with User Demo Data

Warning: This will erase all database data.

./scripts/quick_start

If server setup is complete, start the server:

python manage.py runserver --settings=tally_ho.settings.dev

Loading Tally Demo Data

Note: Add demo result forms and candidate lists.

Advanced: Recreate Database and Load Demo Users

Warning: This erases all database data and only works with files in ./data.

./scripts/reload_all postgres 127.0.0.1 tally_ho.settings.common

Docker Installation

With Docker and docker-compose installed, build and run:

docker-compose build
docker-compose up

Visit 127.0.0.1:8000. For production, modify the docker-compose.yml file:

  1. Change NGINX port from 8000 to 80.
  2. Add your host to ALLOWED_HOSTS in tally_ho/settings/docker.py.

Running Tests

Run tests with:

pytest tally_ho

Documentation

Arabic Translations

Follow these steps for managing Arabic translations:

  1. Add Arabic Language: Update settings.py:

    # settings.py
        LANGUAGES = [
            ('en', 'English'),
            ('ar', 'Arabic'),
    ]
    
    # Ensure LANGUAGE_CODE is set to a default language (e.g., 'en')
        LANGUAGE_CODE = 'en'
  2. Generate Arabic Translation Files:

    django-admin makemessages -l ar
  3. Edit Arabic Translations: Update locale/ar/LC_MESSAGES/django.po.

  4. Compile Translations:

    django-admin compilemessages

Generating Model Graphs

Install requirements from requirements/dev.pip and graphviz.

Generate all model graphs:

python manage.py graph_models --settings=tally_ho.settings.dev --pydot -a -g -o tally-ho-all-models.png

Generate specific app model graphs:

python manage.py graph_models --settings=tally_ho.settings.dev --pydot -a -X GroupObjectPermission,... -g -o tally-ho-app-models.png

Demo Users

Use the create_demo_users command to create demo users with usernames like super_administrator, and password data.

File Uploads

File upload limit is set to 10MB in MAX_FILE_UPLOAD_SIZE within tally_ho/settings/common.py.

News