summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/debugtoolbar.rst
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2018-10-07 02:55:06 -0700
committerSteve Piercy <web@stevepiercy.com>2018-10-07 04:26:35 -0700
commit89ea49c213622ee0aea57138943f2b6d08307e70 (patch)
treea4e36133b8a2ec716f6e9074f353971bfd603e1b /docs/quick_tutorial/debugtoolbar.rst
parent315e469540afeba4bffe7bafb1364a7bab059a24 (diff)
downloadpyramid-89ea49c213622ee0aea57138943f2b6d08307e70.tar.gz
pyramid-89ea49c213622ee0aea57138943f2b6d08307e70.tar.bz2
pyramid-89ea49c213622ee0aea57138943f2b6d08307e70.zip
Add pyramid_debugtoolbar to setup.py, and update narrative text accordingly.
Diffstat (limited to 'docs/quick_tutorial/debugtoolbar.rst')
-rw-r--r--docs/quick_tutorial/debugtoolbar.rst69
1 files changed, 39 insertions, 30 deletions
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('<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?