E-commerce platform using DRF
- User Registration
- User login
- Products table in admin panel only
- All users could add to the cart
- All users could make orders with the products in the cart
-
Create simple Rest APIs endpoints for:
- Registration
- Login
- Add Product model and show it in admin (product fields are: name, price)
- Get products and the query should:
- Order by price
- Search by name
- add to cart
- get user cart
- create an order with products in the cart
- get user orders
-
Use linter for your code (ex: flake8).
-
Add a Readme file containing instructions to run your code
- Adding simple test cases for your code using pytest or another test framework you are familiar with is a plus.
- Adding nginx configuration and supervisor is a plus.
- deploying the task on the server is a plus.
- Using docker and docker-compose with your application is also a plus.
- Used Token Authentication (Storing it in the db, less scalable but simpler to implement)
- Create python virtual environment using conda on virtualenv and activate it
- Install package requirements using pip command within env
- Setup new postgres user and DB and grant him all privileges on it
- Setup sercrets file with the settings.py file accordingly (db_name, host, user, password, port...)
- run
python manage.py makemigrations
- run
python manage.py migrate
- run
python manage.py runserver
to start testing the endpoints locally on 127.0.0.1:8000