Add Django: the most popular Python web framework (~82k ⭐)#71
Add Django: the most popular Python web framework (~82k ⭐)#71MDA2AV merged 4 commits intoMDA2AV:mainfrom
Conversation
- 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.
|
/benchmark |
|
Benchmark run triggered for django — all profiles. Results incoming 🚀 Django's a big framework with a lot of middleware by default, so the numbers won't be in Flask territory — but that's kind of the point. Good to have the baseline for the most popular Python framework. |
|
🚀 Benchmark run triggered for |
Benchmark ResultsFramework: Full log |
|
Django results are in — and honestly, pretty respectable for a full-featured framework running on Gunicorn: Highlights:
Interesting patterns:
Context: The upload issue should probably be fixed before merging — want me to take a look at the Django config? |
- Upload endpoint now reads from wsgi.input in 64KB chunks instead of using request.body which fails on chunked Transfer-Encoding (no CONTENT_LENGTH header) - Set DATA_UPLOAD_MAX_MEMORY_SIZE = None to allow 20MB benchmark uploads - Same streaming pattern used in baseline11 for POST bodies
|
Fixed the upload 4xx issue! Two problems:
Push is up (a0b33cd) — should be ready for a re-benchmark whenever you get a chance! |
|
/benchmark |
|
🚀 Benchmark run triggered for |
Benchmark ResultsFramework: Full log |
|
New results look good! The upload fix is working — went from 0 req/s (all 4xx) to ~870 req/s across concurrency levels. Not blazing fast, but Django is doing real work there with the streaming read + chunked transfer handling. Baseline numbers are consistent with the first run (~111K vs ~113K at 512c — well within normal variance). Quick summary of where Django lands:
The noisy profile is rough (20 req/s) but that's Django's middleware stack + GIL fighting the background CPU load — kind of expected for a sync WSGI framework. Flask will probably look similar there. I think this is ready for a proper review whenever you get a chance 👍 |
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:
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
/jsonand/compressionendpoints/dbEndpoints
/pipelineok/baseline11/baseline2/json/compression/db/uploadTests 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.