Djang Referral System
About | Features | Technologies | Requirements | Starting | License | Author
🎯
About
I created django referral system and I wanna show it for other people! If you wanna contrib you are welcome!
✨
Features
🚀
Technologies
The following tools were used in this project:
✅
Requirements
Before starting
🏁
Starting
# 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
🏁
Works with api
Create account:
POST http://127.0.0.1:8000/auth/jwt/create/
body={
"username":"admin",
"password":"admin"
}
It return:
{
"refresh": "refresh_token",
"access": "access_token"
}
Get tokens list:
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": []
},
...
]
Create new account:
POST http://127.0.0.1:8000/auth/users/
body={
"username":"user",
"password":"password1",
"email":"[email protected]",
"referral_token":"E6VQuA4qFucR028UW0XL6FAW8vw",
}
It return:
{
"referral_token": "E6VQuA4qFucR028UW0XL6FAW8vw",
"email": "[email protected]",
"username": "test1sdas",
"id": 11
}
📝
License
Made with