diff options
| author | Chris McDonough <chrism@plope.com> | 2010-12-18 15:53:49 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-12-18 15:53:49 -0500 |
| commit | 738a2b5f3eb44da7036a31005144e5252827ac38 (patch) | |
| tree | 80e10d2ae215b2e0e1f248354b6c9a5e11406cd5 /docs/narr/vhosting.rst | |
| parent | aa6c4267b330a5665dcb7c98d75fe21f8eeececb (diff) | |
| parent | 70119302324e5bf5627344f90c62ef31b6e43005 (diff) | |
| download | pyramid-738a2b5f3eb44da7036a31005144e5252827ac38.tar.gz pyramid-738a2b5f3eb44da7036a31005144e5252827ac38.tar.bz2 pyramid-738a2b5f3eb44da7036a31005144e5252827ac38.zip | |
Merge branch 'model2resource'
Conflicts:
docs/narr/views.rst
Diffstat (limited to 'docs/narr/vhosting.rst')
| -rw-r--r-- | docs/narr/vhosting.rst | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/docs/narr/vhosting.rst b/docs/narr/vhosting.rst index d1fd1b382..65168806e 100644 --- a/docs/narr/vhosting.rst +++ b/docs/narr/vhosting.rst @@ -85,21 +85,19 @@ Virtual Root Support :term:`traversal` -based (but not :term:`URL dispatch` -based) applications. -Virtual root support is useful when you'd like to host some model in a -:app:`Pyramid` object graph as an application under a URL pathname -that does not include the model path itself. For example, you might -want to serve the object at the traversal path ``/cms`` as an -application reachable via ``http://example.com/`` (as opposed to -``http://example.com/cms``). - -To specify a virtual root, cause an environment variable to be -inserted into the WSGI environ named ``HTTP_X_VHM_ROOT`` with a value -that is the absolute pathname to the model object in the traversal -graph that should behave as the "root" model. As a result, the -traversal machinery will respect this value during traversal -(prepending it to the PATH_INFO before traversal starts), and the -:func:`pyramid.url.model_url` API will generate the "correct" -virtually-rooted URLs. +Virtual root support is useful when you'd like to host some resource in a +:app:`Pyramid` resource tree as an application under a URL pathname that does +not include the resource path itself. For example, you might want to serve the +object at the traversal path ``/cms`` as an application reachable via +``http://example.com/`` (as opposed to ``http://example.com/cms``). + +To specify a virtual root, cause an environment variable to be inserted into +the WSGI environ named ``HTTP_X_VHM_ROOT`` with a value that is the absolute +pathname to the resource object in the resource tree that should behave as +the "root" resource. As a result, the traversal machinery will respect this +value during traversal (prepending it to the PATH_INFO before traversal +starts), and the :func:`pyramid.url.resource_url` API will generate the +"correct" virtually-rooted URLs. An example of an Apache ``mod_proxy`` configuration that will host the ``/cms`` subobject as ``http://www.example.com/`` using this facility |
