[Django] #21442: Configurable request parsing.

17 views
Skip to first unread message

Django

unread,
Nov 15, 2013, 9:19:05 AM11/15/13
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+--------------------
Reporter: tomchristie | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
This ticket if for implementing a request parsing API that ensures the
`Request` objects can nicely handle JSON and other submitted types in
addition the the existing multipart parsing.

The proposed API is based on this discussion:
https://groups.google.com/forum/#!searchin/django-developers/request.DATA
/django-developers/s8OZ9yNh-8c/oCbNL5x6avAJ

* `request.DATA` or `request.data` for accessing the parsed data.
* `request.parsers` or similar for modifying the parsers prior to parsing
on a per-view basis.
* `request.accepted_parser` or similar for branching on media type if
needed.
* A setting `REQUEST_PARSERS` or similar, that controls the default set of
installed parsers.

--
Ticket URL: <https://code.djangoproject.com/ticket/21442>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 19, 2013, 11:51:17 AM11/19/13
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------

Reporter: tomchristie | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:1>

Django

unread,
Mar 31, 2014, 4:13:40 AM3/31/14
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------
Reporter: tomchristie | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by akanouras):

* cc: antonis+djangoproject.com@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:2>

Django

unread,
Nov 10, 2014, 5:40:40 AM11/10/14
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+---------------------------------------
Reporter: tomchristie | Owner: tomchristie
Type: New feature | Status: assigned

Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+---------------------------------------
Changes (by tomchristie):

* owner: nobody => tomchristie
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:3>

Django

unread,
Nov 26, 2015, 7:56:06 AM11/26/15
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+---------------------------------------
Reporter: tomchristie | Owner: tomchristie
Type: New feature | Status: assigned
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+---------------------------------------

Comment (by auvipy):

https://github.com/django/deps/blob/master/draft/content-negotiation.rst

reading the DEP

my thoughts are wouldn't it better/nicer to handle the content negotiation
per view based content negotiation? and there should be decorators to
handle content negotiation in view level?

+ is it really necessary to introduce new global settings?

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:4>

Django

unread,
Nov 26, 2015, 8:06:42 AM11/26/15
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+---------------------------------------
Reporter: tomchristie | Owner: tomchristie
Type: New feature | Status: assigned
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+---------------------------------------

Comment (by auvipy):

or this is the HTTP Handling part only? view parts will be implemented
differently in another ticket? serialization in another part? hope you
don't get me wrong for asking too many questions.

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:5>

Django

unread,
Aug 17, 2017, 1:45:14 PM8/17/17
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+----------------------------------------
Reporter: Tom Christie | Owner: Tom Christie

Type: New feature | Status: assigned
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Mark Lavin):

* cc: Mark Lavin (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:6>

Django

unread,
Jul 12, 2018, 4:11:24 PM7/12/18
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+----------------------------------------
Reporter: Tom Christie | Owner: Tom Christie
Type: New feature | Status: assigned
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------

Comment (by DoHyun Kim):

How's it going? Any update about this issue?

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:7>

Django

unread,
Oct 28, 2021, 5:15:36 AM10/28/21
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------
Reporter: Tom Christie | Owner: (none)

Type: New feature | Status: new
Component: HTTP handling | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Tom Christie => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:8>

Django

unread,
Aug 13, 2022, 1:47:48 AM8/13/22
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------
Reporter: Tom Christie | Owner: (none)
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by timtaiwanliim):

These 3 issues are related.
[1] https://code.djangoproject.com/ticket/21442
[2] https://code.djangoproject.com/ticket/28678
[3] https://github.com/encode/django-rest-framework/issues/4881

[1] is the overall tracker for this issue, desires to create a
configurable parser. Opened 9 years ago.
[3] describes the desired behavior with example. Opened 5 years ago.
[2] has a proposed fix (credit: Facundo Batista). The fix is simple and
worked well when I tried it. Opened 5 years ago.

Surely a configurable parser [1] is a good goal to pursue. But if it
takes 9 years before anything happens, perhaps we can take [2]? It is
not configurable, but it works well.

re: a case for multipart parser that can handle json parts
I have an api that takes some json input, plus 2 optional image files.
With json parser, I cannot easily include image files (base64 works, but
clumsy for modest size images).
Multipart parser allows me to send the json input plus images in 1
call. But all the data parts are treated as text (str). One of the
data field is a dict (eg. { "x": 7, "y": 5 }).
If I use json parser, it is an dict (good).
If I use multipart parser, it becomes a str (bad; desired to get a
dict).

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:9>

Django

unread,
Nov 29, 2022, 10:25:00 AM11/29/22
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------------
Reporter: Tom Christie | Owner: Carlton Gibson

Type: New feature | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------------
Changes (by Carlton Gibson):

* owner: (none) => Carlton Gibson
* needs_better_patch: 0 => 1


* status: new => assigned


Comment:

Following [https://groups.google.com/g/django-developers/c/O8WfDpplXuI
thread on mailing list], we're going to approach by adding the
`request.data` part, adding just JSON handling, before making the accepted
content types pluggable as a second step.

[https://github.com/django/django/pull/16341 Beginning work over here.]
Not yet ready.

Related to #32259 to modernise the request object at the same time.

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:10>

Django

unread,
May 9, 2023, 9:05:34 AM5/9/23
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------
Reporter: Tom Christie | Owner: (none)
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Carlton Gibson):

* owner: Carlton Gibson => (none)


* status: assigned => new


Comment:

De-assigning myself as this has been picked up for GSoC this year.

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:11>

Django

unread,
May 16, 2023, 11:37:37 PM5/16/23
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+-----------------------------------------
Reporter: Tom Christie | Owner: Abhinav Yadav

Type: New feature | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Abhinav Yadav):

* owner: (none) => Abhinav Yadav


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:12>

Django

unread,
Oct 8, 2023, 2:16:20 PM10/8/23
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------------
Reporter: Tom Christie | Owner: Carlton Gibson
Type: New feature | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------------
Changes (by Carlton Gibson):

* owner: Abhinav Yadav => Carlton Gibson


Comment:

OK, this didn’t make it in GSoC. I’m going to pick this back up.

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:13>

Django

unread,
Nov 28, 2023, 4:59:15 AM11/28/23
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------------
Reporter: Tom Christie | Owner: Carlton Gibson
Type: New feature | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"76280b4f4d7547dc869b71c22f658095a1565875" 76280b4f]:
{{{
#!CommitTicketReference repository=""
revision="76280b4f4d7547dc869b71c22f658095a1565875"
Refs #21442 -- Increased test coverage of requests.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:14>

Django

unread,
Dec 7, 2023, 9:00:12 AM12/7/23
to django-...@googlegroups.com
#21442: Configurable request parsing.
-------------------------------+------------------------------------------
Reporter: Tom Christie | Owner: Carlton Gibson
Type: New feature | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------------
Changes (by Abhinav Yadav):

* cc: Abhinav Yadav (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/21442#comment:15>

Reply all
Reply to author
Forward
0 new messages