Skip to content

Add Django: the most popular Python web framework (~82k ⭐)#71

Open
BennyFranciscus wants to merge 3 commits intoMDA2AV:mainfrom
BennyFranciscus:add-django
Open

Add Django: the most popular Python web framework (~82k ⭐)#71
BennyFranciscus wants to merge 3 commits intoMDA2AV:mainfrom
BennyFranciscus:add-django

Conversation

@BennyFranciscus
Copy link
Collaborator

Django — the web framework for perfectionists with deadlines

Adds Django (~82k stars) to HttpArena.

Why Django?

Django is THE most popular Python web framework — period. With ~82k GitHub stars, it's the backbone of Instagram, Pinterest, Mozilla, Disqus, and countless production applications. HttpArena already has Flask (micro, sync) and FastAPI (async, modern) — Django completes the Python trinity.

The matchup everyone wants to see:

  • Flask — minimalist WSGI micro-framework
  • FastAPI — modern async ASGI framework
  • Django — full-featured batteries-included framework

Django carries more weight than Flask (ORM, middleware, URL resolver, settings system) but is incredibly well-optimized after 20 years of production use. This benchmark strips Django to the essentials — no middleware, no ORM — to see how the core request/response pipeline performs.

Setup

  • Django 5.2 on Gunicorn with sync workers (same WSGI setup as Flask for a fair comparison)
  • Workers: 2× CPU cores
  • Minimal settings: no middleware, no installed apps, no debug
  • Pre-computed JSON + gzip for /json and /compression endpoints
  • Thread-local SQLite connections with mmap for /db

Endpoints

Endpoint Method Description
/pipeline GET Returns ok
/baseline11 GET/POST Sum query params (+ body for POST)
/baseline2 GET Sum query params (H2)
/json GET 50-item JSON with computed totals
/compression GET Gzip-compressed large JSON
/db GET SQLite range query
/upload POST Returns byte count

Tests subscribed

baseline, pipelined, noisy, limited-conn, json, upload, compression, mixed

cc @carltongibson @felixxm @sarahboyce — thought it'd be cool to see how Django stacks up in HttpArena! Flask vs FastAPI vs Django is the Python comparison everyone's been waiting for.

@BennyFranciscus BennyFranciscus requested a review from MDA2AV as a code owner March 18, 2026 02:05
- Use request.read() for POST body to handle chunked Transfer-Encoding
- Add @require_GET and @require_http_methods decorators to reject unsupported methods with 405
Django's request.body reads CONTENT_LENGTH bytes from the stream.
With chunked Transfer-Encoding, there's no Content-Length header,
so Django reads 0 bytes. Read from wsgi.input directly as fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant