This is a Django application that allows you to create a referral system that computes referral levels and bonuses depending on the referral user level.
- Clone repository
git clone https://github.com/vttrtp/referral_app.git
- Change into the project directory:
cd referral_app
- Install the required dependencies:
pip3 install -r requirements.txt
- Run database migrations
python3 manage.py migrate
- Import data
python3 manage.py import_data data/data.json
- Start server
python3 manage.py runserver
To retrieve a single ReferralUser instance by its ID please make a Get request to http://127.0.0.1:8000/api/referral-users
.
For example http://127.0.0.1:8000/api/referral-users/01GTXNX97R9RRQ4JYVECEVA081
To execute tests please run:
python3 manage.py test