Yuthance backend API
- A user should be able to create an account.
- A user should be able to log in to their account.
- A user should be able to add an item to cart.
- A user should be able to make a payment
-
Clone this repository and cd into the folder.
git clone https://github.com/SAWM55/yuthancebackend.git
cd yuthancebackend
-
Create a virtual environment
python3 -m venv env
-
Set the environment variables
mv .env.example .env
source .env
-
Install dependencies
pip install -r requirements.txt
-
Perform migrations
python manage.py migrate
-
Create superuser
python manage.py createsuperuser --email admin@example.com --username admin
-
Run the app
python manage.py runserver
-
Testing
pytest
Endpoint | Functionality | HTTP method |
---|---|---|
/users/?format=json |
Register a user | POST |
/users/<int:id> |
view, edit, delete a user | GET, PATCH, DELETE |
/auth/login |
Login a user | POST |
David Macharia @Dave-mash