From 46ad10d4ea3f57c19d7ce54a1539a66d7ed621d2 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 12 Jul 2011 00:13:38 -0400 Subject: add docs about logging config --- docs/narr/startup.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index e2c43b17e..788896de9 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -53,6 +53,10 @@ Here's a high-level time-ordered overview of what happens when you press that particular composite to understand how to make it refer to your :app:`Pyramid` application. +#. The PasteDeploy framework finds all :mod:`logging` related configuration + in the ``.ini`` file and uses it to configure the Python standard library + logging system for this application. + #. The application's *constructor* (named by the entry point reference or dotted Python name on the ``use=`` line of the section representing your :app:`Pyramid` application) is passed the key/value parameters mentioned -- cgit v1.2.3 From 6ce1e0cf1a141767ee0aca70786c15dd993347c5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 20 Jul 2011 06:10:38 -0400 Subject: add more index markers --- docs/narr/startup.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 788896de9..8661c8f6a 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -140,6 +140,10 @@ Here's a high-level time-ordered overview of what happens when you press The server serves the application, and the application is running, waiting to receive requests. +.. index:: + pair: settings; deployment + single: custom settings + .. _deployment_settings: Deployment Settings -- cgit v1.2.3 From 4396c62c5ebb07ffdc418955c251ed4d62d45817 Mon Sep 17 00:00:00 2001 From: Carlos de la Guardia Date: Sun, 24 Jul 2011 11:00:09 -0700 Subject: Rewrote bad sentence --- docs/narr/startup.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 8661c8f6a..68df9d417 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -112,11 +112,11 @@ Here's a high-level time-ordered overview of what happens when you press (which is internal to Paste) such as ``reload_templates``, ``debug_authorization``, etc. -#. The ``main`` function then calls various methods on the an instance of the - class :class:`~pyramid.config.Configurator` method. The intent of - calling these methods is to populate an :term:`application registry`, - which represents the :app:`Pyramid` configuration related to the - application. +#. The ``main`` function then calls various methods on the instance of the + class :class:`~pyramid.config.Configurator` created in the previous step. + The intent of calling these methods is to populate an + :term:`application registry`, which represents the :app:`Pyramid` + configuration related to the application. #. The :meth:`~pyramid.config.Configurator.make_wsgi_app` method is called. The result is a :term:`router` instance. The router is associated with -- cgit v1.2.3 From 875ded31e7fdd0c85d1c91458248581b9dd729d7 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sat, 30 Jul 2011 01:50:24 -0600 Subject: Updated all of the docs to reflect the new pyramid.* settings prefix. --- docs/narr/startup.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 68df9d417..c9ed01f83 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -92,10 +92,10 @@ Here's a high-level time-ordered overview of what happens when you press In this case, the ``myproject.__init__:main`` function referred to by the entry point URI ``egg:MyProject`` (see :ref:`MyProject_ini` for more information about entry point URIs, and how they relate to callables), - will receive the key/value pairs ``{'reload_templates':'true', - 'debug_authorization':'false', 'debug_notfound':'false', - 'debug_routematch':'false', 'debug_templates':'true', - 'default_locale_name':'en'}``. + will receive the key/value pairs ``{'pyramid.reload_templates':'true', + 'pyramid.debug_authorization':'false', 'pyramid.debug_notfound':'false', + 'pyramid.debug_routematch':'false', 'pyramid.debug_templates':'true', + 'pyramid.default_locale_name':'en'}``. #. The ``main`` function first constructs a :class:`~pyramid.config.Configurator` instance, passing a root resource @@ -109,8 +109,8 @@ Here's a high-level time-ordered overview of what happens when you press The ``settings`` dictionary contains all the options in the ``[app:MyProject]`` section of our .ini file except the ``use`` option - (which is internal to Paste) such as ``reload_templates``, - ``debug_authorization``, etc. + (which is internal to Paste) such as ``pyramid.reload_templates``, + ``pyramid.debug_authorization``, etc. #. The ``main`` function then calls various methods on the instance of the class :class:`~pyramid.config.Configurator` created in the previous step. -- cgit v1.2.3 From 3d338ea5737b7c113b17120b40684e2694cf3fa9 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 22 Aug 2011 02:16:55 -0400 Subject: - Use [app:main] instead of a pipeline in all scaffolds and tutorials and narrative docs. - Break out awkward description of PasteDeploy entry points from project chapter into its own Paste chapter. --- docs/narr/startup.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index c9ed01f83..c66264655 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -51,7 +51,9 @@ Here's a high-level time-ordered overview of what happens when you press If instead of a simple application or a pipeline, you're using a Paste "composite" (e.g. ``[composite:main]``), refer to the documentation for that particular composite to understand how to make it refer to your - :app:`Pyramid` application. + :app:`Pyramid` application. In most cases, a Pyramid application built + from a scaffold will have a single ``[app:main]`` section in it, and this + will be the application served. #. The PasteDeploy framework finds all :mod:`logging` related configuration in the ``.ini`` file and uses it to configure the Python standard library @@ -78,10 +80,9 @@ Here's a high-level time-ordered overview of what happens when you press section of an ``.ini`` file. It also accepts a ``**settings`` argument, which collects another set of arbitrary key/value pairs. The arbitrary key/value pairs received by this function in ``**settings`` will be - composed of all the key/value pairs that are present in the - ``[app:MyProject]`` section (except for the ``use=`` setting) when this - function is called by the :term:`PasteDeploy` framework when you run - ``paster serve``. + 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 ``development.ini`` file looks like so: @@ -107,9 +108,9 @@ Here's a high-level time-ordered overview of what happens when you press application's root resource. It is not called during startup, only when a request is handled. - The ``settings`` dictionary contains all the options in the - ``[app:MyProject]`` section of our .ini file except the ``use`` option - (which is internal to Paste) such as ``pyramid.reload_templates``, + The ``settings`` dictionary contains all the options in the ``[app:main]`` + section of our .ini file except the ``use`` option (which is internal to + Paste) such as ``pyramid.reload_templates``, ``pyramid.debug_authorization``, etc. #. The ``main`` function then calls various methods on the instance of the @@ -128,9 +129,9 @@ Here's a high-level time-ordered overview of what happens when you press :ref:`events_chapter` for more information about events). #. Assuming there were no errors, the ``main`` function in ``myproject`` - returns the router instance created by ``make_wsgi_app`` back to - PasteDeploy. As far as PasteDeploy is concerned, it is "just another WSGI - application". + returns the router instance created by + :meth:`pyramid.config.Configurator.make_wsgi_app` back to PasteDeploy. As + far as PasteDeploy is concerned, it is "just another WSGI application". #. PasteDeploy starts the WSGI *server* defined within the ``[server:main]`` section. In our case, this is the ``Paste#http`` server (``use = -- cgit v1.2.3 From cfb2b5596b8ef366aeef3bce5b61eafc7a2f175d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 6 Oct 2011 03:05:29 -0400 Subject: remove all reference to the paster command-line utility --- docs/narr/startup.rst | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index c66264655..f4ebef154 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -8,12 +8,12 @@ you'll see something much like this show up on the console: .. code-block:: text - $ paster serve myproject/MyProject.ini + $ pserve myproject/MyProject.ini Starting server in PID 16601. serving on 0.0.0.0:6543 view at http://127.0.0.1:6543 This chapter explains what happens between the time you press the "Return" -key on your keyboard after typing ``paster serve myproject/MyProject.ini`` +key on your keyboard after typing ``pserve myproject/MyProject.ini`` and the time the line ``serving on 0.0.0.0:6543 ...`` is output to your console. @@ -24,22 +24,21 @@ The Startup Process ------------------- The easiest and best-documented way to start and serve a :app:`Pyramid` -application is to use the ``paster serve`` command against a +application is to use the ``pserve`` command against a :term:`PasteDeploy` ``.ini`` file. This uses the ``.ini`` file to infer settings and starts a server listening on a port. For the purposes of this discussion, we'll assume that you are using this command to run your :app:`Pyramid` application. Here's a high-level time-ordered overview of what happens when you press -``return`` after running ``paster serve development.ini``. +``return`` after running ``pserve development.ini``. -#. The :term:`PasteDeploy` ``paster`` command is invoked under your shell - with the arguments ``serve`` and ``development.ini``. As a result, the - :term:`PasteDeploy` framework recognizes that it is meant to begin to run - and serve an application using the information contained within the - ``development.ini`` file. +#. The ``pserve`` command is invoked under your shell with the argument + ``development.ini``. As a result, Pyramid recognizes that it is meant to + begin to run and serve an application using the information contained + within the ``development.ini`` file. -#. The PasteDeploy framework finds a section named either ``[app:main]``, +#. The framework finds a section named either ``[app:main]``, ``[pipeline:main]``, or ``[composite:main]`` in the ``.ini`` file. This section represents the configuration of a :term:`WSGI` application that will be served. If you're using a simple application (e.g. @@ -48,16 +47,16 @@ Here's a high-level time-ordered overview of what happens when you press configuration. If, instead of a simple application, you're using a WSGI :term:`pipeline` (e.g. a ``[pipeline:main]`` section), the application named on the "last" element will refer to your :app:`Pyramid` application. - If instead of a simple application or a pipeline, you're using a Paste + If instead of a simple application or a pipeline, you're using a "composite" (e.g. ``[composite:main]``), refer to the documentation for that particular composite to understand how to make it refer to your :app:`Pyramid` application. In most cases, a Pyramid application built from a scaffold will have a single ``[app:main]`` section in it, and this will be the application served. -#. The PasteDeploy framework finds all :mod:`logging` related configuration - in the ``.ini`` file and uses it to configure the Python standard library - logging system for this application. +#. The framework finds all :mod:`logging` related configuration in the + ``.ini`` file and uses it to configure the Python standard library logging + system for this application. #. The application's *constructor* (named by the entry point reference or dotted Python name on the ``use=`` line of the section representing your @@ -82,7 +81,7 @@ Here's a high-level time-ordered overview of what happens when you press key/value pairs received by this 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``. + when you run ``pserve``. Our generated ``development.ini`` file looks like so: @@ -110,7 +109,7 @@ Here's a high-level time-ordered overview of what happens when you press The ``settings`` dictionary contains all the options in the ``[app:main]`` section of our .ini file except the ``use`` option (which is internal to - Paste) such as ``pyramid.reload_templates``, + PasteDeploy) such as ``pyramid.reload_templates``, ``pyramid.debug_authorization``, etc. #. The ``main`` function then calls various methods on the instance of the @@ -130,12 +129,12 @@ Here's a high-level time-ordered overview of what happens when you press #. Assuming there were no errors, the ``main`` function in ``myproject`` returns the router instance created by - :meth:`pyramid.config.Configurator.make_wsgi_app` back to PasteDeploy. As - far as PasteDeploy is concerned, it is "just another WSGI application". + :meth:`pyramid.config.Configurator.make_wsgi_app` back to ``pserve``. As + far as ``pserve`` is concerned, it is "just another WSGI application". -#. PasteDeploy starts the WSGI *server* defined within the ``[server:main]`` - section. In our case, this is the ``Paste#http`` server (``use = - egg:Paste#http``), and it will listen on all interfaces (``host = +#. ``pserve`` starts the WSGI *server* defined within the ``[server:main]`` + section. In our case, this is the ``egg:pyramid#wsgiref`` server (``use = + egg:pyramid#wsgiref``), and it will listen on all interfaces (``host = 0.0.0.0``), on port number 6543 (``port = 6543``). The server code itself is what prints ``serving on 0.0.0.0:6543 view at http://127.0.0.1:6543``. The server serves the application, and the application is running, waiting -- cgit v1.2.3 From 2217d19853a5c389dd809983f69fb31e6e7c9c4b Mon Sep 17 00:00:00 2001 From: Cypha Date: Mon, 24 Oct 2011 04:39:04 -0400 Subject: clarified [DEFAULT] as an optional section in .ini --- docs/narr/startup.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index f4ebef154..0d5acfa47 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -76,12 +76,12 @@ Here's a high-level time-ordered overview of what happens when you press Note that the constructor function accepts a ``global_config`` argument, which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` - section of an ``.ini`` file. It also accepts a ``**settings`` argument, - which collects another set of arbitrary key/value pairs. The arbitrary - key/value pairs received by this 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 - when you run ``pserve``. + section of an ``.ini`` file (if ``[DEFAULT]`` is present). It also accepts + a ``**settings`` argument, which collects another set of arbitrary + key/value pairs. The arbitrary key/value pairs received by this 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 when you run ``pserve``. Our generated ``development.ini`` file looks like so: -- cgit v1.2.3 From 62912fda287f613c4a7180c55a31b349e01e6aa8 Mon Sep 17 00:00:00 2001 From: Cypha Date: Tue, 25 Oct 2011 02:45:58 -0400 Subject: updated [DEFAULT] to link to the relevant section --- docs/narr/startup.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 0d5acfa47..971d12b45 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -76,8 +76,10 @@ Here's a high-level time-ordered overview of what happens when you press Note that the constructor function accepts a ``global_config`` argument, which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` - section of an ``.ini`` file (if ``[DEFAULT]`` is present). It also accepts - a ``**settings`` argument, which collects another set of arbitrary + section of an ``.ini`` file (if `[DEFAULT] + `__ is present). It also + accepts a ``**settings`` argument, which collects another set of arbitrary key/value pairs. The arbitrary key/value pairs received by this 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) -- cgit v1.2.3 From d3ce2b6187977608ff0c460ae47aebd04b216679 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 10 Dec 2011 22:39:47 -0500 Subject: update startup chapter against new scaffolding --- docs/narr/startup.rst | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 971d12b45..a7fc5d33c 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -24,11 +24,11 @@ The Startup Process ------------------- The easiest and best-documented way to start and serve a :app:`Pyramid` -application is to use the ``pserve`` command against a -:term:`PasteDeploy` ``.ini`` file. This uses the ``.ini`` file to infer -settings and starts a server listening on a port. For the purposes of this -discussion, we'll assume that you are using this command to run your -:app:`Pyramid` application. +application is to use the ``pserve`` command against a :term:`PasteDeploy` +``.ini`` file. This uses the ``.ini`` file to infer settings and starts a +server listening on a port. For the purposes of this discussion, we'll +assume that you are using this command to run your :app:`Pyramid` +application. Here's a high-level time-ordered overview of what happens when you press ``return`` after running ``pserve development.ini``. @@ -56,11 +56,12 @@ Here's a high-level time-ordered overview of what happens when you press #. The framework finds all :mod:`logging` related configuration in the ``.ini`` file and uses it to configure the Python standard library logging - system for this application. + system for this application. See :ref:`logging_config` for more + information. -#. The application's *constructor* (named by the entry point reference or +#. The application's *constructor* named by the entry point reference or dotted Python name on the ``use=`` line of the section representing your - :app:`Pyramid` application) is passed the key/value parameters mentioned + :app:`Pyramid` application is passed the key/value parameters mentioned within the section in which it's defined. The constructor is meant to return a :term:`router` instance, which is a :term:`WSGI` application. @@ -77,13 +78,13 @@ Here's a high-level time-ordered overview of what happens when you press Note that the constructor function accepts a ``global_config`` argument, which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` section of an ``.ini`` file (if `[DEFAULT] - `__ is present). It also - accepts a ``**settings`` argument, which collects another set of arbitrary - key/value pairs. The arbitrary key/value pairs received by this 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 when you run ``pserve``. + `__ + is present). It also accepts a ``**settings`` argument, which collects + another set of arbitrary key/value pairs. The arbitrary key/value pairs + received by this 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 when you run + ``pserve``. Our generated ``development.ini`` file looks like so: @@ -97,7 +98,8 @@ Here's a high-level time-ordered overview of what happens when you press will receive the key/value pairs ``{'pyramid.reload_templates':'true', 'pyramid.debug_authorization':'false', 'pyramid.debug_notfound':'false', 'pyramid.debug_routematch':'false', 'pyramid.debug_templates':'true', - 'pyramid.default_locale_name':'en'}``. + 'pyramid.default_locale_name':'en'}``. See :ref:`environment_chapter` for + the meanings of these keys. #. The ``main`` function first constructs a :class:`~pyramid.config.Configurator` instance, passing a root resource @@ -105,10 +107,6 @@ Here's a high-level time-ordered overview of what happens when you press ``settings`` dictionary captured via the ``**settings`` kwarg as its ``settings`` argument. - The root resource factory is invoked on every request to retrieve the - application's root resource. It is not called during startup, only when a - request is handled. - The ``settings`` dictionary contains all the options in the ``[app:main]`` section of our .ini file except the ``use`` option (which is internal to PasteDeploy) such as ``pyramid.reload_templates``, -- cgit v1.2.3 From 030d10697cc52a5c26d19818140616a485f63428 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 2 Jan 2012 20:41:44 -0500 Subject: - Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding. --- docs/narr/startup.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index a7fc5d33c..78b119687 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -133,8 +133,8 @@ Here's a high-level time-ordered overview of what happens when you press far as ``pserve`` is concerned, it is "just another WSGI application". #. ``pserve`` starts the WSGI *server* defined within the ``[server:main]`` - section. In our case, this is the ``egg:pyramid#wsgiref`` server (``use = - egg:pyramid#wsgiref``), and it will listen on all interfaces (``host = + section. In our case, this is the Waitress server (``use = + egg:waitress#main``), and it will listen on all interfaces (``host = 0.0.0.0``), on port number 6543 (``port = 6543``). The server code itself is what prints ``serving on 0.0.0.0:6543 view at http://127.0.0.1:6543``. The server serves the application, and the application is running, waiting -- cgit v1.2.3 From 6269a1c058a77438b90a165c6541685c1bfaa8db Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Thu, 1 Mar 2012 14:52:49 +0100 Subject: Remove mention of the `root_factory` argument. The example code earlier on the page does not use the `root_factory` argument, only the `settings` argument. This is a fix for pyramid issue #452. --- docs/narr/startup.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 78b119687..8e28835af 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -102,10 +102,9 @@ Here's a high-level time-ordered overview of what happens when you press the meanings of these keys. #. The ``main`` function first constructs a - :class:`~pyramid.config.Configurator` instance, passing a root resource - factory (constructor) to it as its ``root_factory`` argument, and - ``settings`` dictionary captured via the ``**settings`` kwarg as its - ``settings`` argument. + :class:`~pyramid.config.Configurator` instance, passing the ``settings`` + dictionary captured via the ``**settings`` kwarg as its ``settings`` + argument. The ``settings`` dictionary contains all the options in the ``[app:main]`` section of our .ini file except the ``use`` option (which is internal to -- cgit v1.2.3 From 60ea901969e7ea87a68e7ca3da4032724ca90bb7 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 19 Apr 2012 16:43:31 -0400 Subject: take out 'or dotted python name' --- docs/narr/startup.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 8e28835af..2a764b0ec 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -42,8 +42,8 @@ Here's a high-level time-ordered overview of what happens when you press ``[pipeline:main]``, or ``[composite:main]`` in the ``.ini`` file. This section represents the configuration of a :term:`WSGI` application that will be served. If you're using a simple application (e.g. - ``[app:main]``), the application :term:`entry point` or :term:`dotted - Python name` will be named on the ``use=`` line within the section's + ``[app:main]``), the application's ``paste.app_factory`` :term:`entry + point` will be named on the ``use=`` line within the section's configuration. If, instead of a simple application, you're using a WSGI :term:`pipeline` (e.g. a ``[pipeline:main]`` section), the application named on the "last" element will refer to your :app:`Pyramid` application. -- cgit v1.2.3 From 0569f999db99e50ffd962eb06d51ec1fb4731181 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 19 Apr 2012 16:45:51 -0400 Subject: squash another reference to dotted name --- docs/narr/startup.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 2a764b0ec..f5c741f52 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -59,11 +59,11 @@ Here's a high-level time-ordered overview of what happens when you press system for this application. See :ref:`logging_config` for more information. -#. The application's *constructor* named by the entry point reference or - dotted Python name on the ``use=`` line of the section representing your - :app:`Pyramid` application is passed the key/value parameters mentioned - within the section in which it's defined. The constructor is meant to - return a :term:`router` instance, which is a :term:`WSGI` application. +#. The application's *constructor* named by the entry point reference on the + ``use=`` line of the section representing your :app:`Pyramid` application + is passed the key/value parameters mentioned within the section in which + it's defined. The constructor is meant to return a :term:`router` + instance, which is a :term:`WSGI` application. For :app:`Pyramid` applications, the constructor will be a function named ``main`` in the ``__init__.py`` file within the :term:`package` in which -- cgit v1.2.3 From 62ea1b60f18d8ac0bab2331852f9ef8bee1fad57 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 16 Feb 2013 01:10:49 +0200 Subject: fix link --- docs/narr/startup.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index f5c741f52..3a9225032 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -77,9 +77,9 @@ Here's a high-level time-ordered overview of what happens when you press Note that the constructor function accepts a ``global_config`` argument, which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` - section of an ``.ini`` file (if `[DEFAULT] - `__ - is present). It also accepts a ``**settings`` argument, which collects + section of an ``.ini`` file + (if :ref:`[DEFAULT] ` is present). + It also accepts a ``**settings`` argument, which collects another set of arbitrary key/value pairs. The arbitrary key/value pairs received by this function in ``**settings`` will be composed of all the key/value pairs that are present in the ``[app:main]`` section (except for -- cgit v1.2.3 From 29c8884747d3bc10b55aefce3db461a9e20b3527 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 26 Mar 2013 17:18:57 +0200 Subject: fix #948 --- docs/narr/startup.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 3a9225032..1affa1758 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -8,12 +8,12 @@ you'll see something much like this show up on the console: .. code-block:: text - $ pserve myproject/MyProject.ini + $ pserve development.ini Starting server in PID 16601. serving on 0.0.0.0:6543 view at http://127.0.0.1:6543 This chapter explains what happens between the time you press the "Return" -key on your keyboard after typing ``pserve myproject/MyProject.ini`` +key on your keyboard after typing ``pserve development.ini`` and the time the line ``serving on 0.0.0.0:6543 ...`` is output to your console. -- cgit v1.2.3 From b5655e2e35c6fc57dd54684b1c71b1e11f672a14 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Sun, 9 Feb 2014 23:13:27 -0500 Subject: Apply change from #1221 manually. Avoid the unintentional slight in OPs commit message. --- docs/narr/startup.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 1affa1758..7b4a7ea08 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -123,7 +123,7 @@ Here's a high-level time-ordered overview of what happens when you press populated by other methods run against the Configurator. The router is a WSGI application. -#. A :class:`~pyramid.events.ApplicationCreated` event is emitted (see +#. An :class:`~pyramid.events.ApplicationCreated` event is emitted (see :ref:`events_chapter` for more information about events). #. Assuming there were no errors, the ``main`` function in ``myproject`` -- cgit v1.2.3 From ad76ef6ab78847ef86abf97868a32e9604aaab7e Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Fri, 8 Aug 2014 23:28:13 -0500 Subject: Link to logging configuration in the Startup chapter. The Startup chapter describes the application's .ini file. The Logging chapter describes how to configure logging with the .ini file. --- docs/narr/startup.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 7b4a7ea08..cd44e0ee3 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -139,6 +139,13 @@ Here's a high-level time-ordered overview of what happens when you press The server serves the application, and the application is running, waiting to receive requests. +.. seealso:: + Logging configuration is described in the :ref:`logging_chapter` + chapter. There, in :ref:`request_logging_with_pastes_translogger`, + you will also find an example of how to configure + :term:`middleware` to add pre-packaged functionality to your + application. + .. index:: pair: settings; deployment single: custom settings -- cgit v1.2.3 From 4a63f6ac8f19d21eebf23bd8c9f833f2b676287b Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Fri, 8 Aug 2014 23:30:04 -0500 Subject: Add index entries for .ini files vis settings. --- docs/narr/startup.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index cd44e0ee3..a1a23ed52 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -19,6 +19,7 @@ console. .. index:: single: startup process + pair: settings; .ini The Startup Process ------------------- -- cgit v1.2.3 From 02503c54ca0bdc32aaaf177c3626b4fbe1bf6ce6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 5 Oct 2015 04:20:46 -0700 Subject: - grammar, wrapping to 79 columns --- docs/narr/startup.rst | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index a1a23ed52..b8d3bfac9 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -13,9 +13,8 @@ you'll see something much like this show up on the console: serving on 0.0.0.0:6543 view at http://127.0.0.1:6543 This chapter explains what happens between the time you press the "Return" -key on your keyboard after typing ``pserve development.ini`` -and the time the line ``serving on 0.0.0.0:6543 ...`` is output to your -console. +key on your keyboard after typing ``pserve development.ini`` and the time the +line ``serving on 0.0.0.0:6543 ...`` is output to your console. .. index:: single: startup process @@ -42,14 +41,14 @@ Here's a high-level time-ordered overview of what happens when you press #. The framework finds a section named either ``[app:main]``, ``[pipeline:main]``, or ``[composite:main]`` in the ``.ini`` file. This section represents the configuration of a :term:`WSGI` application that - will be served. If you're using a simple application (e.g. + will be served. If you're using a simple application (e.g., ``[app:main]``), the application's ``paste.app_factory`` :term:`entry point` will be named on the ``use=`` line within the section's - configuration. If, instead of a simple application, you're using a WSGI - :term:`pipeline` (e.g. a ``[pipeline:main]`` section), the application + configuration. If instead of a simple application, you're using a WSGI + :term:`pipeline` (e.g., a ``[pipeline:main]`` section), the application named on the "last" element will refer to your :app:`Pyramid` application. If instead of a simple application or a pipeline, you're using a - "composite" (e.g. ``[composite:main]``), refer to the documentation for + "composite" (e.g., ``[composite:main]``), refer to the documentation for that particular composite to understand how to make it refer to your :app:`Pyramid` application. In most cases, a Pyramid application built from a scaffold will have a single ``[app:main]`` section in it, and this @@ -60,7 +59,7 @@ Here's a high-level time-ordered overview of what happens when you press system for this application. See :ref:`logging_config` for more information. -#. The application's *constructor* named by the entry point reference on the +#. The application's *constructor* named by the entry point referenced on the ``use=`` line of the section representing your :app:`Pyramid` application is passed the key/value parameters mentioned within the section in which it's defined. The constructor is meant to return a :term:`router` @@ -78,14 +77,13 @@ Here's a high-level time-ordered overview of what happens when you press Note that the constructor function accepts a ``global_config`` argument, which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` - section of an ``.ini`` file - (if :ref:`[DEFAULT] ` is present). - It also accepts a ``**settings`` argument, which collects - another set of arbitrary key/value pairs. The arbitrary key/value pairs - received by this 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 when you run - ``pserve``. + section of an ``.ini`` file (if :ref:`[DEFAULT] + ` is present). It also accepts a + ``**settings`` argument, which collects another set of arbitrary + key/value pairs. The arbitrary key/value pairs received by this 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 when you run ``pserve``. Our generated ``development.ini`` file looks like so: @@ -95,7 +93,7 @@ Here's a high-level time-ordered overview of what happens when you press In this case, the ``myproject.__init__:main`` function referred to by the entry point URI ``egg:MyProject`` (see :ref:`MyProject_ini` for more - information about entry point URIs, and how they relate to callables), + information about entry point URIs, and how they relate to callables) will receive the key/value pairs ``{'pyramid.reload_templates':'true', 'pyramid.debug_authorization':'false', 'pyramid.debug_notfound':'false', 'pyramid.debug_routematch':'false', 'pyramid.debug_templates':'true', @@ -141,11 +139,10 @@ Here's a high-level time-ordered overview of what happens when you press to receive requests. .. seealso:: - Logging configuration is described in the :ref:`logging_chapter` - chapter. There, in :ref:`request_logging_with_pastes_translogger`, - you will also find an example of how to configure - :term:`middleware` to add pre-packaged functionality to your - application. + Logging configuration is described in the :ref:`logging_chapter` chapter. + There, in :ref:`request_logging_with_pastes_translogger`, you will also + find an example of how to configure :term:`middleware` to add + pre-packaged functionality to your application. .. index:: pair: settings; deployment -- cgit v1.2.3 From 911882cb691df23747595dda679fbc54a58d06c2 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 9 Oct 2015 00:11:12 -0700 Subject: wrap 79 cols --- docs/narr/startup.rst | 95 +++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 49 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index b8d3bfac9..485f6b181 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -12,9 +12,9 @@ you'll see something much like this show up on the console: Starting server in PID 16601. serving on 0.0.0.0:6543 view at http://127.0.0.1:6543 -This chapter explains what happens between the time you press the "Return" -key on your keyboard after typing ``pserve development.ini`` and the time the -line ``serving on 0.0.0.0:6543 ...`` is output to your console. +This chapter explains what happens between the time you press the "Return" key +on your keyboard after typing ``pserve development.ini`` and the time the line +``serving on 0.0.0.0:6543 ...`` is output to your console. .. index:: single: startup process @@ -26,9 +26,8 @@ The Startup Process The easiest and best-documented way to start and serve a :app:`Pyramid` application is to use the ``pserve`` command against a :term:`PasteDeploy` ``.ini`` file. This uses the ``.ini`` file to infer settings and starts a -server listening on a port. For the purposes of this discussion, we'll -assume that you are using this command to run your :app:`Pyramid` -application. +server listening on a port. For the purposes of this discussion, we'll assume +that you are using this command to run your :app:`Pyramid` application. Here's a high-level time-ordered overview of what happens when you press ``return`` after running ``pserve development.ini``. @@ -40,30 +39,29 @@ Here's a high-level time-ordered overview of what happens when you press #. The framework finds a section named either ``[app:main]``, ``[pipeline:main]``, or ``[composite:main]`` in the ``.ini`` file. This - section represents the configuration of a :term:`WSGI` application that - will be served. If you're using a simple application (e.g., - ``[app:main]``), the application's ``paste.app_factory`` :term:`entry - point` will be named on the ``use=`` line within the section's - configuration. If instead of a simple application, you're using a WSGI - :term:`pipeline` (e.g., a ``[pipeline:main]`` section), the application - named on the "last" element will refer to your :app:`Pyramid` application. - If instead of a simple application or a pipeline, you're using a - "composite" (e.g., ``[composite:main]``), refer to the documentation for - that particular composite to understand how to make it refer to your - :app:`Pyramid` application. In most cases, a Pyramid application built - from a scaffold will have a single ``[app:main]`` section in it, and this - will be the application served. - -#. The framework finds all :mod:`logging` related configuration in the - ``.ini`` file and uses it to configure the Python standard library logging - system for this application. See :ref:`logging_config` for more - information. + section represents the configuration of a :term:`WSGI` application that will + be served. If you're using a simple application (e.g., ``[app:main]``), the + application's ``paste.app_factory`` :term:`entry point` will be named on the + ``use=`` line within the section's configuration. If instead of a simple + application, you're using a WSGI :term:`pipeline` (e.g., a + ``[pipeline:main]`` section), the application named on the "last" element + will refer to your :app:`Pyramid` application. If instead of a simple + application or a pipeline, you're using a "composite" (e.g., + ``[composite:main]``), refer to the documentation for that particular + composite to understand how to make it refer to your :app:`Pyramid` + application. In most cases, a Pyramid application built from a scaffold + will have a single ``[app:main]`` section in it, and this will be the + application served. + +#. The framework finds all :mod:`logging` related configuration in the ``.ini`` + file and uses it to configure the Python standard library logging system for + this application. See :ref:`logging_config` for more information. #. The application's *constructor* named by the entry point referenced on the - ``use=`` line of the section representing your :app:`Pyramid` application - is passed the key/value parameters mentioned within the section in which - it's defined. The constructor is meant to return a :term:`router` - instance, which is a :term:`WSGI` application. + ``use=`` line of the section representing your :app:`Pyramid` application is + passed the key/value parameters mentioned within the section in which it's + defined. The constructor is meant to return a :term:`router` instance, + which is a :term:`WSGI` application. For :app:`Pyramid` applications, the constructor will be a function named ``main`` in the ``__init__.py`` file within the :term:`package` in which @@ -79,11 +77,11 @@ Here's a high-level time-ordered overview of what happens when you press which is a dictionary of key/value pairs mentioned in the ``[DEFAULT]`` section of an ``.ini`` file (if :ref:`[DEFAULT] ` is present). It also accepts a - ``**settings`` argument, which collects another set of arbitrary - key/value pairs. The arbitrary key/value pairs received by this 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 when you run ``pserve``. + ``**settings`` argument, which collects another set of arbitrary key/value + pairs. The arbitrary key/value pairs received by this 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 when you run ``pserve``. Our generated ``development.ini`` file looks like so: @@ -93,8 +91,8 @@ Here's a high-level time-ordered overview of what happens when you press In this case, the ``myproject.__init__:main`` function referred to by the entry point URI ``egg:MyProject`` (see :ref:`MyProject_ini` for more - information about entry point URIs, and how they relate to callables) - will receive the key/value pairs ``{'pyramid.reload_templates':'true', + information about entry point URIs, and how they relate to callables) will + receive the key/value pairs ``{'pyramid.reload_templates':'true', 'pyramid.debug_authorization':'false', 'pyramid.debug_notfound':'false', 'pyramid.debug_routematch':'false', 'pyramid.debug_templates':'true', 'pyramid.default_locale_name':'en'}``. See :ref:`environment_chapter` for @@ -112,13 +110,13 @@ Here's a high-level time-ordered overview of what happens when you press #. The ``main`` function then calls various methods on the instance of the class :class:`~pyramid.config.Configurator` created in the previous step. - The intent of calling these methods is to populate an - :term:`application registry`, which represents the :app:`Pyramid` - configuration related to the application. + The intent of calling these methods is to populate an :term:`application + registry`, which represents the :app:`Pyramid` configuration related to the + application. -#. The :meth:`~pyramid.config.Configurator.make_wsgi_app` method is called. - The result is a :term:`router` instance. The router is associated with - the :term:`application registry` implied by the configurator previously +#. The :meth:`~pyramid.config.Configurator.make_wsgi_app` method is called. The + result is a :term:`router` instance. The router is associated with the + :term:`application registry` implied by the configurator previously populated by other methods run against the Configurator. The router is a WSGI application. @@ -140,9 +138,9 @@ Here's a high-level time-ordered overview of what happens when you press .. seealso:: Logging configuration is described in the :ref:`logging_chapter` chapter. - There, in :ref:`request_logging_with_pastes_translogger`, you will also - find an example of how to configure :term:`middleware` to add - pre-packaged functionality to your application. + There, in :ref:`request_logging_with_pastes_translogger`, you will also find + an example of how to configure :term:`middleware` to add pre-packaged + functionality to your application. .. index:: pair: settings; deployment @@ -155,8 +153,7 @@ Deployment Settings Note that an augmented version of the values passed as ``**settings`` to the :class:`~pyramid.config.Configurator` constructor will be available in -:app:`Pyramid` :term:`view callable` code as ``request.registry.settings``. -You can create objects you wish to access later from view code, and put them -into the dictionary you pass to the configurator as ``settings``. They will -then be present in the ``request.registry.settings`` dictionary at -application runtime. +:app:`Pyramid` :term:`view callable` code as ``request.registry.settings``. You +can create objects you wish to access later from view code, and put them into +the dictionary you pass to the configurator as ``settings``. They will then be +present in the ``request.registry.settings`` dictionary at application runtime. -- cgit v1.2.3 From bf8014ec3458b46c427706988a8ca26380707cd7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 8 Dec 2015 02:43:14 -0800 Subject: update narrative docs and literalinclude source files that use the starter scaffold to reflect its current state --- docs/narr/startup.rst | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'docs/narr/startup.rst') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 485f6b181..3e168eaea 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -6,15 +6,15 @@ Startup When you cause a :app:`Pyramid` application to start up in a console window, you'll see something much like this show up on the console: -.. code-block:: text +.. code-block:: bash - $ pserve development.ini - Starting server in PID 16601. - serving on 0.0.0.0:6543 view at http://127.0.0.1:6543 + $ $VENV/bin/pserve development.ini + Starting server in PID 16305. + serving on http://127.0.0.1:6543 This chapter explains what happens between the time you press the "Return" key on your keyboard after typing ``pserve development.ini`` and the time the line -``serving on 0.0.0.0:6543 ...`` is output to your console. +``serving on http://127.0.0.1:6543`` is output to your console. .. index:: single: startup process @@ -92,11 +92,11 @@ Here's a high-level time-ordered overview of what happens when you press In this case, the ``myproject.__init__:main`` function referred to by the entry point URI ``egg:MyProject`` (see :ref:`MyProject_ini` for more information about entry point URIs, and how they relate to callables) will - receive the key/value pairs ``{'pyramid.reload_templates':'true', - 'pyramid.debug_authorization':'false', 'pyramid.debug_notfound':'false', - 'pyramid.debug_routematch':'false', 'pyramid.debug_templates':'true', - 'pyramid.default_locale_name':'en'}``. See :ref:`environment_chapter` for - the meanings of these keys. + receive the key/value pairs ``{pyramid.reload_templates = true, + pyramid.debug_authorization = false, pyramid.debug_notfound = false, + pyramid.debug_routematch = false, pyramid.default_locale_name = en, and + pyramid.includes = pyramid_debugtoolbar}``. See :ref:`environment_chapter` + for the meanings of these keys. #. The ``main`` function first constructs a :class:`~pyramid.config.Configurator` instance, passing the ``settings`` @@ -131,10 +131,9 @@ Here's a high-level time-ordered overview of what happens when you press #. ``pserve`` starts the WSGI *server* defined within the ``[server:main]`` section. In our case, this is the Waitress server (``use = egg:waitress#main``), and it will listen on all interfaces (``host = - 0.0.0.0``), on port number 6543 (``port = 6543``). The server code itself - is what prints ``serving on 0.0.0.0:6543 view at http://127.0.0.1:6543``. - The server serves the application, and the application is running, waiting - to receive requests. + 127.0.0.1``), on port number 6543 (``port = 6543``). The server code itself + is what prints ``serving on http://127.0.0.1:6543``. The server serves the + application, and the application is running, waiting to receive requests. .. seealso:: Logging configuration is described in the :ref:`logging_chapter` chapter. -- cgit v1.2.3