From 89ea49c213622ee0aea57138943f2b6d08307e70 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 7 Oct 2018 02:55:06 -0700 Subject: Add pyramid_debugtoolbar to setup.py, and update narrative text accordingly. --- docs/quick_tutorial/debugtoolbar.rst | 69 +++++++++++++++++-------------- docs/quick_tutorial/debugtoolbar/setup.py | 1 + 2 files changed, 40 insertions(+), 30 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/debugtoolbar.rst b/docs/quick_tutorial/debugtoolbar.rst index b49dd1f97..c82a47340 100644 --- a/docs/quick_tutorial/debugtoolbar.rst +++ b/docs/quick_tutorial/debugtoolbar.rst @@ -32,30 +32,39 @@ Objectives 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 @@ temporarily. 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('

Hello World!

') + def hello_world(request): + return Response('

Hello World!

') - to: + to: - .. code-block:: python + .. code-block:: python - def hello_world(request): - return xResponse('

Hello World!

') + def hello_world(request): + return xResponse('

Hello World!

') - 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? diff --git a/docs/quick_tutorial/debugtoolbar/setup.py b/docs/quick_tutorial/debugtoolbar/setup.py index a93cf6a73..1c948f52b 100644 --- a/docs/quick_tutorial/debugtoolbar/setup.py +++ b/docs/quick_tutorial/debugtoolbar/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'pyramid_debugtoolbar', 'waitress', ] -- cgit v1.2.3