Ticket #10328: 10328.diff
File 10328.diff, 2.8 KB (added by , 15 years ago) |
---|
-
docs/topics/http/urls.txt
858 858 The :func:`django.db.models.permalink` decorator is useful for writing short 859 859 methods that return a full URL path. For example, a model's 860 860 ``get_absolute_url()`` method. See :func:`django.db.models.permalink` for more. 861 862 get_script_prefix() 863 ------------------- 864 865 .. function:: get_script_prefix() 866 867 .. versionadded:: 1.0 868 869 Normally, you should always use :func:`~django.core.urlresolvers.reverse` or 870 :func:`~django.db.models.permalink` to define URLs within your application. 871 However, if your application constructs part of the URL hierarchy itself, you 872 may occasionally need to generate URLs. In that case, you need to be able to 873 find the base URL of the Django project within its web server 874 (normally, :func:`~django.core.urlresolvers.reverse` takes care of this for 875 you). In that case, you can call ``get_script_prefix()``, which will return the 876 script prefix portion of the URL for your Django project. If your Django 877 project is at the root of its webserver, this is always ``"/"``, but it can be 878 changed, for instance by using ``django.root`` (see :ref:`How to use 879 Django with Apache and mod_python <howto-deployment-modpython>`). -
docs/ref/request-response.txt
32 32 33 33 .. attribute:: HttpRequest.path 34 34 35 A string representing the full path to the requested page, not including36 the domain.35 A string representing the full path to the requested page, not including 36 the domain. 37 37 38 Example: ``"/music/bands/the_beatles/"``38 Example: ``"/music/bands/the_beatles/"`` 39 39 40 .. attribute:: HttpRequest.path_info 41 42 Under some web server configurations, the portion of the URL after the host 43 name is split up into a script prefix portion and a path info portion 44 (this happens, for example, when using the ``django.root`` option 45 with the :ref:`modpython handler from Apache <howto-deployment-modpython>`). 46 The ``path_info`` attribute always contains the path info portion of the 47 path, no matter what web server is being used. Using this instead of 48 attr:`~HttpRequest.path` can make your code much easier to move between test 49 and deployment servers. 50 51 For example, if the ``django.root`` for your application is set to 52 ``"/minfo"``, then ``path`` might be ``"/minfo/music/bands/the_beatles/"`` 53 and ``path_info`` would be ``"/music/bands/the_beatles/"``. 54 40 55 .. attribute:: HttpRequest.method 41 56 42 57 A string representing the HTTP method used in the request. This is