Steve Piercy
2018-10-07 89ea49c213622ee0aea57138943f2b6d08307e70
Add pyramid_debugtoolbar to setup.py, and update narrative text accordingly.
2 files modified
70 ■■■■■ changed files
docs/quick_tutorial/debugtoolbar.rst 69 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/debugtoolbar/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/debugtoolbar.rst
@@ -32,30 +32,39 @@
Steps
=====
#. First we copy the results of the previous step, as well as install the
   ``pyramid_debugtoolbar`` package:
#.  First we copy the results of the previous step.
   .. code-block:: bash
    .. code-block:: bash
       cd ..; cp -r ini debugtoolbar; cd debugtoolbar
       $VENV/bin/pip install -e .
       $VENV/bin/pip install pyramid_debugtoolbar
        cd ..; cp -r ini debugtoolbar; cd debugtoolbar
#. Our ``debugtoolbar/development.ini`` gets a configuration entry for
   ``pyramid.includes``:
#.  Add ``pyramid_debugtoolbar`` to our project dependencies in ``setup.py``:
   .. literalinclude:: debugtoolbar/development.ini
       :language: ini
       :linenos:
    .. literalinclude:: debugtoolbar/setup.py
        :language: python
        :linenos:
        :emphasize-lines: 5
#. Run the WSGI application with:
#.  Install our project and its newly added dependency.
   .. code-block:: bash
    .. code-block:: bash
       $VENV/bin/pserve development.ini --reload
        $VENV/bin/pip install -e .
#. Open http://localhost:6543/ in your browser. See the handy
   toolbar on the right.
#.  Our ``debugtoolbar/development.ini`` gets a configuration entry for ``pyramid.includes``:
    .. literalinclude:: debugtoolbar/development.ini
        :language: ini
        :linenos:
#.  Run the WSGI application with:
    .. code-block:: bash
        $VENV/bin/pserve development.ini --reload
#.  Open http://localhost:6543/ in your browser.
    See the handy toolbar on the right.
Analysis
@@ -93,24 +102,24 @@
Extra credit
============
#. Why don't we add ``pyramid_debugtoolbar`` to the list of
   ``install_requires`` dependencies in ``debugtoolbar/setup.py``?
#.  We added ``pyramid_debugtoolbar`` to the list of ``install_requires`` dependencies in ``debugtoolbar/setup.py`` because this tutorial is for development and educational purposes only.
    In what cases would you *not* want to add ``pyramid_debugtoolbar`` to your dependencies?
#. Introduce a bug into your application. Change:
#.  Introduce a bug into your application. Change:
   .. code-block:: python
    .. code-block:: python
       def hello_world(request):
           return Response('<body><h1>Hello World!</h1></body>')
        def hello_world(request):
            return Response('<body><h1>Hello World!</h1></body>')
   to:
    to:
   .. code-block:: python
    .. code-block:: python
       def hello_world(request):
           return xResponse('<body><h1>Hello World!</h1></body>')
        def hello_world(request):
            return xResponse('<body><h1>Hello World!</h1></body>')
   Save, and visit http://localhost:6543/ again. Notice the nice traceback
   display. On the lowest line, click the "screen" icon to the right, and try
   typing the variable names ``request`` and ``Response``. What else can you
   discover?
    Save, and visit http://localhost:6543/ again.
    Notice the nice traceback display.
    On the lowest line, click the "screen" icon to the right, and try typing the variable names ``request`` and ``Response``.
    What else can you discover?
docs/quick_tutorial/debugtoolbar/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'pyramid_debugtoolbar',
    'waitress',
]