summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-17 12:50:06 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-17 12:50:06 +0000
commit133aa5eb4bae0c274a3f695dec3afc7b16a1fd83 (patch)
tree11d71f38e51f1dbb6463521eaf2699cd36270c2f /docs
parentec72071615f31a81ad171e184ec5327f81a94286 (diff)
Fixed #6119 -- Documented HttpRequest.get_host(). Thanks, PJCrosier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6941 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/request_response.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/request_response.txt b/docs/request_response.txt
index c8d6423841..e3d794c9ba 100644
--- a/docs/request_response.txt
+++ b/docs/request_response.txt
@@ -156,6 +156,18 @@ Methods
Returns ``True`` or ``False``, designating whether ``request.GET`` or
``request.POST`` has the given key.
+``get_host()``
+ **New in Django development version**
+
+ Returns the originating host of the request using information from the
+ ``HTTP_X_FORWARDED_HOST`` and ``HTTP_HOST`` headers (in that order). If
+ they don't provide a value, the method uses a combination of
+ ``SERVER_NAME`` and ``SERVER_PORT`` as detailed in `PEP 333`_.
+
+ .. _PEP 333: http://www.python.org/dev/peps/pep-0333/
+
+ Example: ``"127.0.0.1:8000"``
+
``get_full_path()``
Returns the ``path``, plus an appended query string, if applicable.