diff options
| author | Chris McDonough <chrism@plope.com> | 2010-11-19 22:28:50 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-11-19 22:28:50 -0500 |
| commit | 614f00c88733b5248922e2b610c96f7c8c3ff57c (patch) | |
| tree | c178e586f021abe0aca3975ec44f328fd7ccd806 /docs/narr/firstapp.rst | |
| parent | ff3811e4a776f096869d860309d4cff04dcb99ba (diff) | |
| download | pyramid-614f00c88733b5248922e2b610c96f7c8c3ff57c.tar.gz pyramid-614f00c88733b5248922e2b610c96f7c8c3ff57c.tar.bz2 pyramid-614f00c88733b5248922e2b610c96f7c8c3ff57c.zip | |
- Remove calls to config.begin()/config.end() from startup config code in
tutorials and paster templates (no longer required).
Diffstat (limited to 'docs/narr/firstapp.rst')
| -rw-r--r-- | docs/narr/firstapp.rst | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst index bc21bf29f..9d3cad13c 100644 --- a/docs/narr/firstapp.rst +++ b/docs/narr/firstapp.rst @@ -38,10 +38,8 @@ configured imperatively: if __name__ == '__main__': config = Configurator() - config.begin() config.add_view(hello_world) config.add_view(goodbye_world, name='goodbye') - config.end() app = config.make_wsgi_app() serve(app, host='0.0.0.0') @@ -149,10 +147,8 @@ imports and function definitions is placed within the confines of an if __name__ == '__main__': config = Configurator() - config.begin() config.add_view(hello_world) config.add_view(goodbye_world, name='goodbye') - config.end() app = config.make_wsgi_app() serve(app, host='0.0.0.0') @@ -190,29 +186,6 @@ this particular :app:`Pyramid` application. Methods called on the Configurator will cause registrations to be made in a :term:`application registry` associated with the application. -Beginning Configuration -~~~~~~~~~~~~~~~~~~~~~~~ - -.. ignore-next-block -.. code-block:: python - - config.begin() - -The :meth:`pyramid.configuration.Configurator.begin` method tells -the system that application configuration has begun. In particular, -this causes the :term:`application registry` associated with this -configurator to become the "current" application registry, meaning -that code which attempts to use the application registry :term:`thread -local` will obtain the registry associated with the configurator. -This is an explicit step because it's sometimes convenient to use a -configurator without causing the registry associated with the -configurator to become "current". - -.. note:: - - See :ref:`threadlocals_chapter` for a discussion about what it - means for an application registry to be "current". - .. _adding_configuration: Adding Configuration @@ -281,28 +254,6 @@ important. We can register ``goodbye_world`` first and ``hello_world`` second; :app:`Pyramid` will still give us the most specific callable when a request is dispatched to it. -Ending Configuration -~~~~~~~~~~~~~~~~~~~~ - -.. ignore-next-block -.. code-block:: python - - config.end() - -The :meth:`pyramid.configuration.Configurator.end` method tells the -system that application configuration has ended. It is the inverse of -:meth:`pyramid.configuration.Configurator.begin`. In particular, -this causes the :term:`application registry` associated with this -configurator to no longer be the "current" application registry, -meaning that code which attempts to use the application registry -:term:`thread local` will no longer obtain the registry associated -with the configurator. - -.. note:: - - See :ref:`threadlocals_chapter` for a discussion about what it - means for an application registry to be "current". - .. index:: single: make_wsgi_app single: WSGI application |
