#29208: Mistake in the documentation, request.POST['username'] is not working,
but
request.POST.get('username') is working!
----------------------------------+--------------------------------------
Reporter: Marat Mkhitaryan | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 4.0
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Comment (by Carlton Gibson):
I don't recall commenting here, but I do agree. The example is
pedagogical… — it shows using `login()` -- making it production worthy
would obscure the point trying to be made.
Claude's comment:2 seems right:
> If you use that in a context where it might not be the case, then yes,
you should defensively use .get(). That's pure standard Python behaviour.
--
Ticket URL: <https://code.djangoproject.com/ticket/29208#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/073.202e25eef9df9780fd098c7e477f8e10%40djangoproject.com.