About | Features | Technologies | Requirements | Starting | License | Author
I created django referral system and I wanna show it for other people! If you wanna contrib you are welcome!
✔️ New user can signUp only with referral code;
✔️ Each new user get 3 referral codes for friends;
✔️ Each new admin get 5 referral codes;
The following tools were used in this project:
Before starting 🏁, you need to have Git and Python + Poetry installed. In the project I used postgresql, you need to start postgresql so you need Docker-compose.
# Clone this project
$ git clone https://github.com/mur4ik18/django-referral-system && cd django-referral-system
# Install dependencies
$ poetry install
# Run env
$ poetry shell
# Run postgresql (If you don't have)
$ docker-compose -f db.yml up --build -d
# Start project
$ python src/manage.py runserver
POST http://127.0.0.1:8000/auth/jwt/create/
body={
"username":"admin",
"password":"admin"
}
It return:
{
"refresh": "refresh_token",
"access": "access_token"
}
GET http://127.0.0.1:8000/api/v1/get_tokens/
Headers={
"Authorization":"JWT access_token",
}
It return:
[
{
"token": "w3iP8GJt1woqLRM6MNrNx88JxuI",
"user": 1,
"refer_relations": [
{
"employer": 1,
"employee": 10,
"refer_token": 1
}
]
},
{
"token": "E6VQuA4qFucR028UW0XL6FAW8vw",
"user": 1,
"refer_relations": []
},
...
]
POST http://127.0.0.1:8000/auth/users/
body={
"username":"user",
"password":"password1",
"email":"user@gmail.com",
"referral_token":"E6VQuA4qFucR028UW0XL6FAW8vw",
}
It return:
{
"referral_token": "E6VQuA4qFucR028UW0XL6FAW8vw",
"email": "test@test.com1",
"username": "test1sdas",
"id": 11
}
Made with ❤️ by mur4ik18