PRP
  • PRP Documentation
  • Introduction
    • Glossary / Terminology
    • Indicators
      • Disaggregations
      • Calculating progress
    • FAQ
    • Releases / Changelog*
    • Report an Issue / Contact us
  • Product / End-user Documentation
    • IP Reporting
      • Overview
      • Partner roles and permissions
      • User Interface
      • Setting calculation methods for indicators
      • Progress Reports
        • Reporting Overview
        • Special Reports (SR)
        • Humanitarian Reports (HR)
        • Quarterly Progress Reports (QPR)
        • Reporting Process
        • Data Uploader for QPR and HR
      • Various data exports
    • Cluster Reporting
      • Overview
      • User Authentication, Roles and permissions
      • AD Integration
      • Response Plans
      • Cluster Indicators
      • Response Plan Dashboard
      • Response Parameters setup
      • Planning your action as a Partner
      • Reporting on results
        • Reporting to UNICEF
      • Analysis of results
      • OCHA Integration
    • ID Management
      • Overview
      • AD Integration & Sign In
      • Email Notifications
      • User Statuses
      • Permissions
      • IP ID Management
        • User Interface
        • Users screen
      • Cluster ID Management
        • User Interface
        • Users screen
        • Partners screen
  • Technical Documentation
    • Architecture
    • Development Setup
    • Deployment / DevOps
    • Data Model
    • API Documentation
      • Error Handling
    • CartoDB location sync
    • OCHA Integration - Research Summary
      • Response Plan Import
      • Project Import
    • ID Management
      • Backend API's
    • Handover session question
Powered by GitBook
On this page
  • Local Setup
  • K8s remote environment setup
  • Helpful Commands
  1. Technical Documentation

Development Setup

PreviousArchitectureNextDeployment / DevOps

Last updated 6 years ago

Local Setup

  1. Install for your OS. Also install Fabric via pip install fabric

  2. Create .env file with the reference of.env.exampleor receive .env file from your team member.

  3. Runfab up

  4. Go to to see the frontend / polymer running. The Django app is running under . ID management will be running at .

  5. Runfab fixtures

    • It loads fake data like account, core, partner and other modules!

    • Once fixtures are loaded, the Celery Periodic Tasks will be shown at Django Admin -> djcelery -> Periodic Tasks. Once the tasks are enabled, they will be scheduled to run automatically.

      • If you'd like to get PMP data going now, run fab ssh:django_api and run ./manage.py shell_plus . Then import some celery task functions.

        • from core.tasks import *

        • from partner.tasks import *

        • process_workspaces()

        • process_partners()

        • We would import programme documents later on.

  6. Go to Django Admin -> Core -> Carto db tables. Add new record for each CartoDB dataset to import. Start from admin level 0 to N and import site one by one per country. Please see for more info.

    1. Once the locations are imported, now you can run Programme Document sync from PMP. Run fab ssh:django_api and run ./manage.py shell_plus . Then import some celery task functions.

      1. from unicef.tasks import *

      2. process_programme_documents(True, <BUSINESS_AREA_CODE>)

  7. Run fab ssh:django_api and run ./manage.py shell_plus to create some superusers. Make sure you use .set_password() method to set the password and save the user.

    1. Make sure you create a User with username default_unicef_user for PMP integration.

  8. After creating some users, go to Django Admin -> Core -> Prp roles. Create new Prp role per user to give ID management access on IP reporting and cluster reporting.

  9. Go to login with admin/Passw0rd! and can now go to

    to see the frontend interface. Replace 'ip-reporting' or 'cluster-reporting' in the URL's or use UI switcher to switch between the two interfaces.

K8s remote environment setup

  1. Make sure all K8s deployment and services are running. Ingress controller should be set up to handle L7 routes to Django backend, Polymer, and React deployment.

  2. Polymer and React deployment should be using bundle command and serve it with express http server.

  3. Make sure Ingress controller is running HTTPS annotation.

  4. Configure Frontend and backend deployments with environment variables for API credentials, connection info, and etc.

  5. Make sure Ingress Controller to handle routing for /, /api, and /id-management correctly. Especially for /id-management, Ingress controller needs to make sure that the routing for id-management is taken by id-management deployment.

  6. Go to Django backend pod's SSH shell. Run to load fixtures.

    • ./manage.py loaddata sites

    • ./manage.py loaddata reporting_entities

    • ./manage.py loaddata periodic_tasks

      • It loads fake data like account, core, partner and other modules!

    • Once fixtures are loaded, the Celery Periodic Tasks will be shown at Django Admin -> djcelery -> Periodic Tasks. Once the tasks are enabled, they will be scheduled to run automatically.

      • If you'd like to get PMP data going now, go to Django backend pod's SSH shell. Run ./manage.py shell_plus . Then import some celery task functions.

        • from core.tasks import *

        • from partner.tasks import *

        • process_workspaces()

        • process_partners()

        • We would import programme documents later on.

    1. Once the locations are imported, now you can run Programme Document sync from PMP. Go to Django backend pod's SSH shell. Run ./manage.py shell_plus . Then import some celery task functions.

      1. from unicef.tasks import *

      2. process_programme_documents(True, <BUSINESS_AREA_CODE>)

  7. Go to Django backend pod's SSH shell. Run ./manage.py shell_plus to create some superusers. Make sure you use .set_password() method to set the password and save the user.

    1. Make sure you create a User with username default_unicef_user for PMP integration.

  8. After creating some users, go to Django Admin -> Core -> Prp roles. Create new Prp role per user to give ID management access on IP reporting and cluster reporting.

Helpful Commands

Here are some docker tips:

display all containers:

$ docker-compose ps

ssh into running django_api container

$ fab ssh:django_api

Restart just one container

$ fab restart:django_api

Stop all containers by kill signal

$ fab kill

Re-build docker images for containers

$ fab rebuild

Go to Django Admin -> Core -> Carto db tables. Add new record for each CartoDB dataset to import. Start from admin level 0 to N and import site one by one per country. Please see for more info.

Docker
http://127.0.0.1:8082/
http://127.0.0.1:8082/api/
http://127.0.0.1:8082/id-management/
CartoDB location sync section
http://127.0.0.1:8082/api/admin/
http://127.0.0.1:8082/app/
CartoDB location sync section