diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-11-10 05:03:02 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-11-10 05:03:02 +0000 |
| commit | c1bc021263d4ae2299851b809d5c4d0e48399f61 (patch) | |
| tree | a9d3c98f77da8ad0df31cc8501722594c7e407bb /docs/narr/startup.rst | |
| parent | a461666449e767cf570e5689b13103037c538eb0 (diff) | |
| download | pyramid-c1bc021263d4ae2299851b809d5c4d0e48399f61.tar.gz pyramid-c1bc021263d4ae2299851b809d5c4d0e48399f61.tar.bz2 pyramid-c1bc021263d4ae2299851b809d5c4d0e48399f61.zip | |
Templates
---------
- Remove ``ez_setup.py`` and its import from all paster templates,
samples, and tutorials for ``distribute`` compatibility. The
documentation already explains how to install virtualenv (which will
include some ``setuptools`` package), so these files, imports and
usages were superfluous.
Deprecations
------------
- The ``options`` kw arg to the ``repoze.bfg.router.make_app``
function is deprecated. In its place is the keyword argument
``settings``. The ``options`` keyword continues to work, and a
deprecation warning is not emitted when it is detected. However,
the paster templates, code samples, and documentation now make
reference to ``settings`` rather than ``options``. This
change/deprecation was mainly made for purposes of clarity and
symmetry with the ``get_settings()`` API and dicussions of
"settings" in various places in the docs: we want to use the same
name to refer to the same thing everywhere.
Diffstat (limited to 'docs/narr/startup.rst')
| -rw-r--r-- | docs/narr/startup.rst | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index bb3882a91..d75e57029 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -74,11 +74,11 @@ press ``return`` after running ``paster serve MyProject.ini``. Note that the constructor function accepts a ``global_config`` argument (which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` section of the configuration file). It also accepts - a ``**kw`` argument, which collects another set of arbitrary + a ``**settings`` argument, which collects another set of arbitrary key/value pairs. The arbitrary key/value pairs received by this - function in ``**kw`` will be composed of all the key/value pairs - that are present in the ``[app:main]`` section (except for the - ``use=`` setting) when this function is called by the + function in ``**settings`` will be composed of all the key/value + pairs that are present in the ``[app:main]`` section (except for + the ``use=`` setting) when this function is called by the :term:`PasteDeploy` framework when you run ``paster serve``. Our generated ``MyProject.ini`` file looks like so: @@ -102,13 +102,14 @@ press ``return`` after running ``paster serve MyProject.ini``. Note that the ``app`` function imports the ``get_root`` :term:`root factory` function from the ``myproject.models`` Python module. It then also imports the "bare" ``myproject`` package, and passes - ``get_root``, ``myproject``, and the ``options`` keyword as the + ``get_root``, ``myproject``, and the ``settings`` keyword as the ``app`` function's extra keyword arguments to the ``make_app`` - function of the ``repoze.bfg.router`` module. ``**kw`` here + function of the ``repoze.bfg.router`` module. ``**settings`` here contains all the options in the ``[app:main]`` section of our .ini file except the "use" option (which is internal to paste). In this - case, ``**kw`` will be something like ``{'reload_templates':'true', - 'debug_authorization':'false', 'debug_notfound':'false'}``. + case, ``**settings`` will be something like + ``{'reload_templates':'true', 'debug_authorization':'false', + 'debug_notfound':'false'}``. ``get_root`` is the first argument to ``make_app``, and it is a root factory callable that is invoked on every request to retrieve @@ -124,7 +125,7 @@ press ``return`` after running ``paster serve MyProject.ini``. If you for some reason need or want to load a different application registry filename for your application, you can pass an optional ``filename=`` parameter to make_app (e.g. ``make_app(get_root, - myproject, filename='meta.zcml', options=options``). If the + myproject, filename='meta.zcml', settings=settings``). If the filename is absolute, the ``package`` argument is ignored. #. The ``make_app`` function does its work. It finds and parses the |
