diff options
Diffstat (limited to 'docs/narr/static.rst')
| -rw-r--r-- | docs/narr/static.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/narr/static.rst b/docs/narr/static.rst index 90ee61f6c..e350bc693 100644 --- a/docs/narr/static.rst +++ b/docs/narr/static.rst @@ -1,9 +1,9 @@ Static Resources ================ -:mod:`pyramid` makes it possible to serve up "static" (non-dynamic) +:app:`Pyramid` makes it possible to serve up "static" (non-dynamic) resources from a directory on a filesystem. This chapter describes -how to configure :mod:`pyramid` to do so. +how to configure :app:`Pyramid` to do so. .. index:: single: add_static_view @@ -14,7 +14,7 @@ Serving Static Resources ------------------------ Use the :meth:`pyramid.configuration.Configurator.add_static_view` to -instruct :mod:`pyramid` to serve static resources such as JavaScript and CSS +instruct :app:`Pyramid` to serve static resources such as JavaScript and CSS files. This mechanism makes static files available at a name relative to the application root URL, e.g. ``/static``. @@ -25,7 +25,7 @@ qualified :term:`resource specification` or an *absolute path*. Here's an example of a use of :meth:`pyramid.configuration.Configurator.add_static_view` that will serve files up under the ``/static`` URL from the ``/var/www/static`` directory of -the computer which runs the :mod:`pyramid` application using an absolute +the computer which runs the :app:`Pyramid` application using an absolute path. .. code-block:: python @@ -169,7 +169,7 @@ of a static URL declaration, the generated URLs will continue to resolve properly after the rename. URLs may also be generated by :func:`pyramid.url.static_url` to static -resources that live *outside* the :mod:`pyramid` application. This will +resources that live *outside* the :app:`Pyramid` application. This will happen when the :meth:`pyramid.configuration.Configurator.add_static_view` API associated with the path fed to :func:`pyramid.url.static_url` is a *URL* instead of a view name. For example, the ``name`` argument may be @@ -204,7 +204,7 @@ type. The :class:`pyramid.view.static` helper class is used to perform this task. This class creates an object that is capable acting as a -:mod:`pyramid` view callable which serves static resources from a +:app:`Pyramid` view callable which serves static resources from a directory. For instance, to serve files within a directory located on your filesystem at ``/path/to/static/dir`` mounted at the URL path ``/static`` in your application, create an instance of the @@ -239,7 +239,7 @@ represents your root object. context='mypackage.models.Root') In this case, ``mypackage.models.Root`` refers to the class of which your -:mod:`pyramid` application's root object is an instance. +:app:`Pyramid` application's root object is an instance. You can also omit the ``context`` argument if you want the name ``static`` to be accessible as the static view against any model. This will also allow |
