Django RF notes #1
Elvin Seyidov

Elvin Seyidov @elvinseyidov

About: Results-driven Python/Django Developer with 6+ years of experience in building scalable ERP and CRM solutions for e-commerce, logistics, and more.

Location:
Baku, Azerbaijan
Joined:
Jun 26, 2024

Django RF notes #1

Publish Date: Mar 4
0 0
  1. What is Django REST Framework? Why DRF over vanilla Django views

REST vs RPC — what DRF enforces

When to use DRF in a project

🔹 2. Installing & Setting Up DRF
Adding to INSTALLED_APPS

Basic config in settings.py

Browsable API — quick demo benefit

🔹 3. Serializers (The Heart of DRF)
serializers.Serializer vs serializers.ModelSerializer

Fields, validation, .create() / .update()

Read-only / write-only fields

Nesting serializers (brief teaser)

🔹 4. Basic API Views
Function-based views using @api_view

Class-based views with APIView

Difference between them (flexibility vs structure)

🔹 5. Generic Views & Viewsets
ListAPIView, RetrieveAPIView, etc.

ModelViewSet and how it maps to routers

Routers and URL routing

When to use ViewSet vs GenericAPIView

🔹 6. CRUD with ViewSet + ModelSerializer
Clean example: Book or Note model API

Endpoints: list, retrieve, create, update, delete

Auto-generated routes with DefaultRouter

🔹 7. Testing via Browsable API + curl/Postman
Browsable API introspection

Token vs session auth in API testing

🔹 8. Basic Permissions & Auth (Intro)
IsAuthenticated, AllowAny

Setting default permissions

Mention TokenAuth for later deep-dive

🔹 9. Best Practices (Early Stage)
Keep serializers thin — move logic to model or services

Use ModelViewSet for rapid CRUD, override for custom behavior

Return consistent response structures

Use pagination from the start

🔹 10. Coming Soon (Teasers for Next Notes)
JWT & OAuth2

Custom permissions

Throttling & rate limiting

Filtering, searching, and ordering

Versioning and schema generation

Comments 0 total

    Add comment