A simple Django REST Framework project demonstrating APIs using APIView
and ViewSet with DefaultRouter.
| Method | Response |
|---|---|
| GET | Returns list of coding languages |
| POST | Accepts name, returns personalized message |
| PUT | Confirms PUT method |
| PATCH | Confirms PATCH method |
| DELETE | Confirms DELETE method |
| Action | Method | Response |
|---|---|---|
| list | GET | Returns list of colours |
| retrieve | GET /pk/ |
Fetch single item |
| partial_update | PATCH /pk/ |
Partial update |
| destroy | DELETE /pk/ |
Delete item |
GET /api/
{
"msg": "Happy Coding",
"coding": ["python", "java", "C#", "javaScript", "C++"]
}POST /api/
{
"msg": "Hey Sajjad Ali, Happy ending of DRF classes"
}GET /test-view-set/
{
"msg": "Learning DRF",
"colours": ["red", "green", "blue"]
}git clone https://github.com/sajjadali-fullstack/drf-apiview-viewset-demo.git
cd drf-apiview-viewset-demo
pip install -r requirements.txt
python manage.py runserver







