This Django application demonstrates the integration of Safaricom's M-Pesa Daraja API to initiate an STK Push. STK (Sim Toolkit) Push is a feature provided by Safaricom that allows merchants to initiate M-Pesa transactions on behalf of customers.
Python (version 3.11.7) Django (version 3.2.20) Django-daraja(version 2.0)
a requirement.txt is provided for dependancies
Installation
git clone https://github.com/denisganga/django-daraja-API.git
cd django-daraja-APIpython3 -m venv myenvenv
On Linux/macOS:
source myenv/bin/activateOn Windows:
myenv/scripts/activatepip install -r requirements.txtsetup your credentials from your developer account
python3 manage.py migrate python3 manage.py runserverAccess the application at http://localhost:8000/index/.
Acknowledgments
Safaricom due to Django Daraja library for M-Pesa integration.