summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2010-09-12 19:44:19 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2010-09-12 19:44:19 +0000
commit030c97b119bea450cc4e1f289a95e91aa664221c (patch)
tree3fdaada3057db89ae1e7e33c0e8a3d889b2240d7 /docs/ref
parent7bb6abed129015ad447bd78506698f34c4d8273b (diff)
Documented how to manually piece together URLs with get_script_name().
Thanks to timo and leovitch for the patch. Fixed #10328. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13772 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/request-response.txt21
1 files changed, 18 insertions, 3 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index bf984f4fa8..fb38b596e9 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -30,10 +30,25 @@ All attributes except ``session`` should be considered read-only.
.. attribute:: HttpRequest.path
- A string representing the full path to the requested page, not including
- the domain.
+ A string representing the full path to the requested page, not including
+ the domain.
- Example: ``"/music/bands/the_beatles/"``
+ Example: ``"/music/bands/the_beatles/"``
+
+.. attribute:: HttpRequest.path_info
+
+ Under some web server configurations, the portion of the URL after the host
+ name is split up into a script prefix portion and a path info portion
+ (this happens, for example, when using the ``django.root`` option
+ with the :ref:`modpython handler from Apache <howto-deployment-modpython>`).
+ The ``path_info`` attribute always contains the path info portion of the
+ path, no matter what web server is being used. Using this instead of
+ attr:`~HttpRequest.path` can make your code much easier to move between test
+ and deployment servers.
+
+ For example, if the ``django.root`` for your application is set to
+ ``"/minfo"``, then ``path`` might be ``"/minfo/music/bands/the_beatles/"``
+ and ``path_info`` would be ``"/music/bands/the_beatles/"``.
.. attribute:: HttpRequest.method