MO1.2.1 Install the modular openIMIS backend

In this section, we will provide the install guide for the modular openIMIS backend (API) as services in Windows or standalone applications in Linux. Please follow the appropriate setup based on your server configuration.

Download modular openIMIS backend

  • Download and unzip the release from Github openimis-be_py into a new folder (e.g. C:\openIMIS\backend).

Install python and dependencies

  • Install Python 3 (recommended in a virtualenv)

  • Install pip

  • Within openimis-be_py directory

    • install openIMIS (external) dependencies: 

      1 pip install -r requirements.txt
    • generate the openIMIS modules dependencies file (from openimis.json config; adapt the list of modules if necessary): 

      1 python modules-requirements.py openimis.json > modules-requirements.txt
    • install openIMIS current modules: 

      1 pip install -r modules-requirements.txt

Configure the database connection

  • By default, openIMIS is connected to MS-SQL Server:

    • via ODBC (and pyodbc) driver

    • using TCP/IP protocol (with server DNS name as hostname or localhost) and fixed port (leave DB_PORT here below empty for dynamic port)

    • SQL Server (not Windows/AD) authentication (user name password managed in SQL Server admin). Download and install the ODBC that corresponds to your OS and MS-SQL Server version (https://docs.microsoft.com/en-us/sql/connect/odbc/)

  • Create an openimis-be_py/.env file to provide your database connection info:

    1 2 3 4 5 DB_HOST=mssql-host-server DB_PORT=mssql-port DB_NAME=database-name DB_USER=database-user DB_PASSWORD=database-password
  • Instead of .env file, you can use environment variables (e.g. provided as parameters in the docker-compose.yml).

  • Default used Django database 'engine' in openIMIS is sql_server.pyodbc. If you need to use another one, use the DB_ENGINE entry in the .env file.

  • Default 'options' in openIMIS are {'driver': 'ODBC Driver 17 for SQL Server','unicode_results': True}. If you need to provide other options, use the DB_OPTIONS entry in the .env file (be complete: the new JSON string will entirely replace the default one).

  • At this stage, you may (depends on the database you connect to) need to:

    • apply Django migrations, from openimis-be_py/openIMIS

      1 python manage.py migrate
    • create a superuser for Django admin console, from openimis-be_py/openIMIS

      1 python manage.py createsuperuser

Run the modular openIMIS backend locally

Start openIMIS from within openimis-be_py/openIMISpython manage.py runserver

Run the modular openIMIS backend as a service

  •