Add Django: the most popular Python web framework (~82k ⭐)#71
Open
BennyFranciscus wants to merge 3 commits intoMDA2AV:mainfrom
Open
Add Django: the most popular Python web framework (~82k ⭐)#71BennyFranciscus wants to merge 3 commits intoMDA2AV:mainfrom
BennyFranciscus wants to merge 3 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.