#36332: Usage notes and examples for HttpRequest.path and HttpRequest.path_info
in
docs are mixed up
-------------------------------------+-------------------------------------
Reporter: Kashemir001 | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: wsgi httprequest | Triage Stage: Accepted
path_info |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):
* stage: Unreviewed => Accepted
Comment:
I agree that the examples are mixed up and we should have the following:
{{{#!diff
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -351,14 +351,14 @@ Methods
Returns the ``path``, plus an appended query string, if applicable.
- Example: ``"/music/bands/the_beatles/?print=true"``
+ Example: ``"/minfo/music/bands/the_beatles/?print=true"``
.. method:: HttpRequest.get_full_path_info()
Like :meth:`get_full_path`, but uses :attr:`path_info` instead of
:attr:`path`.
- Example: ``"/minfo/music/bands/the_beatles/?print=true"``
+ Example: ``"/music/bands/the_beatles/?print=true"``
}}}
The test you have linked seems to be a misleading test, the prefix is in
path rather than path info see:
-
https://github.com/django/django/blob/d755a98b8438c10f3cff61303ceb1fe16d414e9b/django/core/handlers/wsgi.py#L67
-
https://github.com/django/django/blob/d755a98b8438c10f3cff61303ceb1fe16d414e9b/django/core/handlers/asgi.py#L57
-
https://github.com/django/django/blob/d755a98b8438c10f3cff61303ceb1fe16d414e9b/tests/handlers/tests.py#L345
Would you like to create a PR?
--
Ticket URL: <https://code.djangoproject.com/ticket/36332#comment:2>
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 visit
https://groups.google.com/d/msgid/django-updates/010701964455e06c-652dabf6-108f-46dd-a5f1-4d3d05d487f1-000000%40eu-central-1.amazonses.com.