Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

This guide provides step-by-step instructions for setting up the openIMIS Backend (Python) on Windows. Follow these steps to clone the repository, configure the environment, install dependencies, migrate the database, and start the server.

Prerequisites

  • Git installed.

  • Python installed (preferably Python 3.x).

  • Command Prompt (cmd.exe) available.

Step-by-Step Instructions

1. Clone openIMIS Backend Project

Clone the openIMIS Backend repository from GitHub.

git clone <https://github.com/openimis/openimis-be_py.git>

2. Create .env File

Navigate into the cloned repository directory and create a .env file based on the provided example.env file. Replace placeholders <your database user name>, <your database user password>, and <your database name> with your actual database credentials.

3. Set up Virtual Environment and Install Dependencies

Open Command Prompt and navigate to the cloned repository (openimis-be_py).

Create a Virtual Environment

python -m venv venv

Activate the Virtual Environment

venv\Scripts\activate

Install Requirements

Install required Python packages using requirements.txt.

pip install -r requirements.txt

Install External Dependencies

Install additional dependencies required by openIMIS.

python script\modules-requirements.py openimis.json > modules-requirements.txt
pip install -r modules-requirements.txt
pip install -U 'Twisted[tls,http2]'

4. Migrate the Database

Navigate to the openIMIS directory within the repository.

cd openIMIS

Run migrations to set up the database schema.

python manage.py migrate

5. Start the Server

Run the development server to start the openIMIS Backend.

Default Port (8000)

python manage.py runserver

Specific Port

To run the server on a specific port (e.g., 8080):

python manage.py runserver 8080

Summary

You have now successfully set up and started the openIMIS Backend on your local machine. Ensure that the server is running and accessible as per your requirements.

  • No labels