Backend Installation Guide
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.10)
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.
Copy the file “openimis.json“ to the folder “Script“
cd script
python 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.
Did you encounter a problem or do you have a suggestion?
Please contact our Service Desk
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/