~/talk

HttpRequest: An unsung hero of Django

Talkat PyCon AU 2023 · 2023-08-18..08-22· [django, python]
slides:none on file

Django’s HttpRequest actually parses and normalizes headers (case and hyphen/underscore quirks), parses Content-Type and Accept, exposes request.body with safeguards (prevents double reads, enforces max upload size and spooling), provides get_host and allowed hosts checks, builds safe full and absolute URLs (IRI→URI, dot-dot cleanup), unifies scheme across WSGI/ASGI, parses POST/files via upload handlers, and offers signed cookie helpers — concrete protections and utilities you get without reimplementing each edge case.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 2:08Django's protection through the request object
  3. 3:54Handling headers in Django requests
  4. 7:04Host header and security protections
  5. 8:54URL path handling and edge cases
  6. 10:17Detecting HTTPS and scheme resolution
  7. 11:42Building absolute URLs safely
  8. 12:45Reading and parsing request content
  9. 14:12Content encoding and charset handling
  10. 14:54Processing POST data and files
  11. 16:38File upload limits and handlers
  12. 17:22Cookie handling and signed cookies
  13. 19:29Q&A: Cookie handling improvements
  14. 20:52Q&A: Comparing HTTP request implementations
  15. 22:38Q&A: When to bypass Django's request handling
  16. 24:27Q&A: Using signed cookies from JavaScript
  17. 25:10Q&A: Header case sensitivity in Django
  18. 26:37Q&A: Django vs other Python web frameworks
  19. 29:06Closing remarks and acknowledgments
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.