-
Notifications
You must be signed in to change notification settings - Fork 0
Framework Comparison
Rishap Gandhi edited this page May 16, 2026
·
1 revision
A comparison of Python frameworks supported by this repo to help you choose the right one.
| Feature | FastAPI | Django | DRF | Flask |
|---|---|---|---|---|
| Type | Async API | Full-stack | REST API (Django) | Lightweight API |
| Async native | ✅ | Partial | ❌ | ❌ |
| ORM | SQLAlchemy 2.x | Django ORM | Django ORM | SQLAlchemy |
| Validation | Pydantic v2 | Django Forms | DRF Serializers | Marshmallow/Pydantic |
| Auto docs | ✅ (OpenAPI) | ❌ | ✅ (drf-spectacular) | ❌ (needs Flask-RESTX) |
| Admin panel | ❌ | ✅ Built-in | ✅ Built-in | ❌ |
| Learning curve | Low | Medium | Medium | Low |
| Performance | ⚡ High | Medium | Medium | Medium |
| Best for | Microservices, APIs | Full-stack apps | Django REST APIs | Internal tools, small APIs |
| Layer | Library |
|---|---|
| Framework | FastAPI 0.111+ |
| Server | Uvicorn + Gunicorn |
| ORM | SQLAlchemy 2.x async + Alembic |
| Validation | Pydantic v2 |
| Auth | python-jose / PyJWT + passlib |
| HTTP Client | httpx (async) |
| Task Queue | Celery + Redis or ARQ |
| Settings | pydantic-settings |
| Layer | Library |
|---|---|
| Framework | Django 5.x |
| ORM | Django ORM (built-in) |
| Migrations | Django migrations |
| Settings | django-environ or pydantic-settings |
| Static Files | WhiteNoise |
| Task Queue | Celery + Redis |
| Caching | django-redis |
| Admin | Django Admin + django-jazzmin |
| Layer | Library |
|---|---|
| Framework | djangorestframework 3.15+ |
| JWT Auth | djangorestframework-simplejwt |
| Filtering | django-filter |
| Schema/Docs | drf-spectacular (OpenAPI 3) |
| Pagination | DRF built-in + custom |
| Throttling | DRF built-in |
| Layer | Library |
|---|---|
| Framework | Flask 3.x |
| ORM | SQLAlchemy 2.x + Flask-SQLAlchemy |
| Migrations | Flask-Migrate (Alembic) |
| Validation | marshmallow or pydantic v2 |
| Auth | Flask-JWT-Extended |
| Settings | python-decouple / pydantic-settings |
| CLI | Click (built-in) |
| Scenario | Recommended Framework |
|---|---|
| New async API / microservice | FastAPI |
| Full-stack app with admin panel | Django |
| REST API on existing Django project | DRF |
| Small internal tool / prototype | Flask |
| High-performance async workloads | FastAPI |
| Rapid prototyping with ORM + admin | Django |
| Lightweight API, minimal dependencies | Flask |
| Team already knows Django | DRF |
All frameworks in this repo follow the same layer discipline:
API Layer (routes/views)
↓
Service Layer (business logic)
↓
Repository Layer (data access)
↓
Model Layer (ORM models)
This is enforced via the skill files regardless of which framework you choose.
- 4 spaces indentation, full type annotations
- structlog for logging (never
print()) - pydantic-settings for configuration
- pytest + factory_boy for testing
- 80% minimum test coverage
- All endpoints authenticated unless explicitly public
- Domain exceptions with HTTP mapping