summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/static.rst38
1 files changed, 19 insertions, 19 deletions
diff --git a/docs/narr/static.rst b/docs/narr/static.rst
index 34e115802..7ff979b28 100644
--- a/docs/narr/static.rst
+++ b/docs/narr/static.rst
@@ -65,25 +65,6 @@ is a view name. When ``name`` is a *URL* (or any string with a slash
webserver. In this mode, the ``name`` is used as the URL prefix when
generating a URL using the :func:`pyramid.url.static_url` function.
-.. note::
-
- Using :func:`pyramid.url.static_url` in conjunction with a
- :meth:`pyramid.configuration.Configurator.add_static_view` makes it
- possible to put static media on a separate webserver during production (if
- the ``name`` argument to
- :meth:`pyramid.configuration.Configurator.add_static_view` is a URL),
- while keeping static media package-internal and served by the development
- webserver during development (if the ``name`` argument to
- :meth:`pyramid.configuration.Configurator.add_static_view` is a view
- name). To create such a circumstance, we suggest using the
- :attr:`pyramid.registry.Registry.settings` API in conjunction with a
- setting in the application ``.ini`` file named ``media_location``. Then
- set the value of ``media_location`` to either a view name or a URL
- depending on whether the application is being run in development or in
- production (use a different `.ini`` file for production than you do for
- development). This is just a suggestion for a pattern; any setting name
- other than ``media_location`` could be used.
-
For example, :meth:`pyramid.configuration.Configurator.add_static_view` may
be fed a ``name`` argument which is ``http://example.com/images``:
@@ -109,6 +90,25 @@ to :meth:`pyramid.configuration.Configurator.add_static_view`. Use of the
:ref:`static_directive` ZCML directive is completely equivalent to using
imperative configuration for the same purpose.
+.. note::
+
+ Using :func:`pyramid.url.static_url` in conjunction with a
+ :meth:`pyramid.configuration.Configurator.add_static_view` makes it
+ possible to put static media on a separate webserver during production (if
+ the ``name`` argument to
+ :meth:`pyramid.configuration.Configurator.add_static_view` is a URL),
+ while keeping static media package-internal and served by the development
+ webserver during development (if the ``name`` argument to
+ :meth:`pyramid.configuration.Configurator.add_static_view` is a view
+ name). To create such a circumstance, we suggest using the
+ :attr:`pyramid.registry.Registry.settings` API in conjunction with a
+ setting in the application ``.ini`` file named ``media_location``. Then
+ set the value of ``media_location`` to either a view name or a URL
+ depending on whether the application is being run in development or in
+ production (use a different `.ini`` file for production than you do for
+ development). This is just a suggestion for a pattern; any setting name
+ other than ``media_location`` could be used.
+
.. index::
single: generating static resource urls
single: static resource urls