Django
Django is a high-level Python web framework that takes a "batteries included" approach: it ships with an ORM, an admin interface, an authentication system, a templating engine, a forms library, and a migrations system, all designed to work together. Django is used by Instagram, Pinterest, Mozilla, NASA, and countless startups and government applications.
Core pieces
- Models. Python classes that map to database tables; the Django ORM handles queries and migrations.
- Views. Functions or class-based views that handle HTTP requests.
- Templates. Django Template Language (DTL) or Jinja for rendering HTML.
- URLs. URL routing via a Python module of patterns mapped to views.
- Admin. Auto-generated admin interface backed by the model metadata; a stand-out feature for internal tools.
- Middleware. Request and response interception layer.
Django vs Django REST Framework vs FastAPI
- Django. Server-rendered apps and traditional MPAs; mature, batteries-included.
- Django REST Framework (DRF). Built on Django for JSON APIs; serializers, viewsets, permissions.
- FastAPI. Async-first, type-driven, OpenAPI-by-default; newer projects often pick FastAPI for API-only services.
🔗