diff options
Diffstat (limited to 'docs/tutorials')
| -rw-r--r-- | docs/tutorials/bfgwiki/basiclayout.rst | 9 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki2/authorization.rst | 12 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki2/basiclayout.rst | 16 | ||||
| -rw-r--r-- | docs/tutorials/gae/index.rst | 9 | ||||
| -rw-r--r-- | docs/tutorials/zeo/index.rst | 6 |
5 files changed, 23 insertions, 29 deletions
diff --git a/docs/tutorials/bfgwiki/basiclayout.rst b/docs/tutorials/bfgwiki/basiclayout.rst index 738972fd1..e2f8ac00e 100644 --- a/docs/tutorials/bfgwiki/basiclayout.rst +++ b/docs/tutorials/bfgwiki/basiclayout.rst @@ -109,8 +109,9 @@ be in ``run.py`` and its ``app`` function: #. *Lines 17 - 18*. We create a :term:`root factory` using the finder. -#. Line *19*. We use the ``repoze.bfg.router.make_app`` to return a - :term:`WSGI` application. The ``make_app`` function takes the root - factory (``get_root``), the *package* representing our application, - and the settings keywords parsed by PasteDeploy. +#. Line *19*. We construct a :term:`Configurator` with a + :term:`root_factory` and the settings keywords parsed by + PasteDeploy. The root factory is named ``get_root``. We then use + the ``make_wsgi_app`` method of the :term:`Configurator` to return + a :term:`WSGI` application. diff --git a/docs/tutorials/bfgwiki2/authorization.rst b/docs/tutorials/bfgwiki2/authorization.rst index f701b4ef8..5257bbe5f 100644 --- a/docs/tutorials/bfgwiki2/authorization.rst +++ b/docs/tutorials/bfgwiki2/authorization.rst @@ -25,10 +25,10 @@ security declarations; when we begin to use a custom root factory to generate our contexts, we can begin to make use of the declarative security features of :mod:`repoze.bfg`. -Let's modify our ``run.py``, passing in a :term:`root factory` as the -first argument to ``repoze.bfg.router.make_app``. We'll point it at a -new class we create inside our ``models.py`` file. Add the following -statements to your ``models.py`` file: +Let's modify our ``run.py``, passing in a :term:`root factory` to our +:term:`Configurator` constructor. We'll point it at a new class we +create inside our ``models.py`` file. Add the following statements to +your ``models.py`` file: .. code-block:: python @@ -58,8 +58,8 @@ See :ref:`assigning_acls` for more information about what an :ref:`route_zcml_directive` for more info. We'll pass the ``RootFactory`` we created in the step above in as the -first argument to ``make_app``. When we're done, your application's -``run.py`` will look like this. +``root_factory`` argument to a :term:`Configurator`. When we're done, +your application's ``run.py`` will look like this. .. literalinclude:: src/authorization/tutorial/run.py :linenos: diff --git a/docs/tutorials/bfgwiki2/basiclayout.rst b/docs/tutorials/bfgwiki2/basiclayout.rst index 4cb37aa91..b8d0ddcc2 100644 --- a/docs/tutorials/bfgwiki2/basiclayout.rst +++ b/docs/tutorials/bfgwiki2/basiclayout.rst @@ -132,12 +132,12 @@ be in ``run.py`` and its ``app`` function: #. Line *25*. We initialize our SQL database using SQLAlchemy, passing it the db string. -#. Line *26*. We use the ``repoze.bfg.router.make_app`` to return a - :term:`WSGI` application. The ``make_app`` function's first - parameter is the "root factory", which is used by the - :mod:`repoze.bfg` :term:`traversal` mechanism. Since this is a URL - dispatch application, the root factory is ``None``. The second - argument is the *package* representing our application, and the - third argument, ``settings`` is passed as a keyword argument. It - contains a dictionary of settings parsed by PasteDeploy. +#. Line *26*. We construct a :term:`Configurator`. The first + argument provided to the configurator is the :term:`root factory`, + which is used by the :mod:`repoze.bfg` :term:`traversal` mechanism. + Since this is a URL dispatch application, the root factory is + ``None``. The second argument ``settings`` is passed as a keyword + argument. It contains a dictionary of settings parsed by + PasteDeploy. We then use the ``make_wsgi_app`` method of the + :term:`Configurator` to return a :term:`WSGI` application. diff --git a/docs/tutorials/gae/index.rst b/docs/tutorials/gae/index.rst index 2cdb3bf81..a165ff5f1 100644 --- a/docs/tutorials/gae/index.rst +++ b/docs/tutorials/gae/index.rst @@ -81,7 +81,7 @@ system. #. Edit ``config.py`` Edit the ``APP_NAME`` and ``APP_ARGS`` settings within - ``config.py``. The APP_NAME must be ``bfgapp.run:make_app``, and + ``config.py``. The ``APP_NAME`` must be ``bfgapp.run:app``, and the APP_ARGS must be ``({},)``. Any other settings in ``config.py`` should remain the same. @@ -91,13 +91,6 @@ system. APP_NAME = 'bfgapp.run:app' APP_ARGS = ({},) - .. warning:: It's very important that the ``APP_NAME`` is - ``bfgapp.run:app`` instead of ``bfgapp.run.make_app``. If you - use the latter by mistake, you'll be confused for at least an - hour when debugging an error like this: ``IOError: [Errno 2] No - such file or directory: - '/Users/chrism/projects/bfg_gae/bfgapp2/app/configure.zcml'``. - #. Edit ``runner.py`` To prevent errors for ``import site``, add this code stanza before diff --git a/docs/tutorials/zeo/index.rst b/docs/tutorials/zeo/index.rst index 6519145db..145bdf4f5 100644 --- a/docs/tutorials/zeo/index.rst +++ b/docs/tutorials/zeo/index.rst @@ -162,7 +162,7 @@ Configuration .. code-block:: python :linenos: - from repoze.bfg.router import make_app + from repoze.bfg.configuration import Configurator from repoze.zodbconn.finder import PersistentApplicationFinder from myapp.models import MyModel import transaction @@ -176,8 +176,8 @@ Configuration finder = PersistentApplicationFinder(zodb_uri, appmaker) def get_root(request): return finder(request.environ) - import myapp - return make_app(get_root, myapp, settings=settings) + config = Configurator(root_factory=get_root, settings=settings) + return config.make_wsgi_app() def appmaker(root): if not 'myapp' in root: |
