This project provides a shopping cart system with user authentication, role-based access control, and various cart management and product item management functionalities. Built using Django and Django Rest Framework (DRF)
- Install Dependencies:
pip install -r requirements.txt- Database Setup:
python manage.py makemigrations
python manage.py migrate- Create a Superuser (Admin):
python manage.py createsuperuser- Run Development Server:
python manage.py runserver- Testing
python manage.py testAccess django admin panel at localhost:8000/admin
Database used : db.sqlite3 (Since it's easy to setup for development. It is a single compact file in a well-defined cross-platform format. For production environment, it is better to changed it to postgresql or other sql variants depending upon further usecases)
Pass Token <token_generated_by_login_or_registration> as Authorization in Headers while triggering any non public APIs
Returns JWT Token and User Data
POST /api/core/user/loginReturns JWT Token and Created User Data
POST /api/core/user/register POST /api/core/user/suspend_user/<int:user_id>' POST /api/item/add_item/' POST /api/item/add_items/' PUT /api/item/edit_item/<int:item_id>' DELETE /api/item/delete_item/<int:item_id>' POST /api/user/cart/add_item/<str:product_name>' DELETE /api/user/cart/remove_item/<str:product_name>' GET /api/user/cart/list_items/'