summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2018-10-07 04:00:19 -0700
committerSteve Piercy <web@stevepiercy.com>2018-10-07 04:26:35 -0700
commit84aa10ae8dbc46ccf8201e8c69efce132fcf7bed (patch)
treec892fb1766116fd7db17140373a76282cffdc712 /docs
parent4e1175a5d701afdc98c09fd4dfe0b90db00a4e3a (diff)
downloadpyramid-84aa10ae8dbc46ccf8201e8c69efce132fcf7bed.tar.gz
pyramid-84aa10ae8dbc46ccf8201e8c69efce132fcf7bed.tar.bz2
pyramid-84aa10ae8dbc46ccf8201e8c69efce132fcf7bed.zip
Add pyramid_jinja2 as a requirement.
Carry forward previous setup.py changes.
Diffstat (limited to 'docs')
-rw-r--r--docs/quick_tutorial/jinja2.rst58
-rw-r--r--docs/quick_tutorial/jinja2/setup.py11
2 files changed, 44 insertions, 25 deletions
diff --git a/docs/quick_tutorial/jinja2.rst b/docs/quick_tutorial/jinja2.rst
index 6c33e406e..23a9982d3 100644
--- a/docs/quick_tutorial/jinja2.rst
+++ b/docs/quick_tutorial/jinja2.rst
@@ -22,45 +22,55 @@ Objectives
Steps
=====
-#. In this step let's start by copying the ``view_class`` step's directory,
- and then installing the ``pyramid_jinja2`` add-on.
+#. In this step let's start by copying the ``view_class`` step's directory from a few steps ago.
- .. code-block:: bash
+ .. code-block:: bash
- cd ..; cp -r view_classes jinja2; cd jinja2
- $VENV/bin/pip install -e .
- $VENV/bin/pip install pyramid_jinja2
+ cd ..; cp -r view_classes jinja2; cd jinja2
-#. We need to include ``pyramid_jinja2`` in ``jinja2/tutorial/__init__.py``:
+#. Add ``pyramid_jinja2`` to our project's dependencies in ``setup.py``:
- .. literalinclude:: jinja2/tutorial/__init__.py
- :linenos:
+ .. literalinclude:: jinja2/setup.py
+ :language: python
+ :linenos:
+ :emphasize-lines: 7
-#. Our ``jinja2/tutorial/views.py`` simply changes its ``renderer``:
+#. Install our project and its newly added dependency.
- .. literalinclude:: jinja2/tutorial/views.py
- :linenos:
+ .. code-block:: bash
-#. Add ``jinja2/tutorial/home.jinja2`` as a template:
+ $VENV/bin/pip install -e .
- .. literalinclude:: jinja2/tutorial/home.jinja2
- :language: html
+#. We need to include ``pyramid_jinja2`` in ``jinja2/tutorial/__init__.py``:
-#. Now run the tests:
+ .. literalinclude:: jinja2/tutorial/__init__.py
+ :linenos:
- .. code-block:: bash
+#. Our ``jinja2/tutorial/views.py`` simply changes its ``renderer``:
- $VENV/bin/pytest tutorial/tests.py -q
- ....
- 4 passed in 0.40 seconds
+ .. literalinclude:: jinja2/tutorial/views.py
+ :linenos:
-#. Run your Pyramid application with:
+#. Add ``jinja2/tutorial/home.jinja2`` as a template:
- .. code-block:: bash
+ .. literalinclude:: jinja2/tutorial/home.jinja2
+ :language: html
- $VENV/bin/pserve development.ini --reload
+#. Now run the tests:
-#. Open http://localhost:6543/ in your browser.
+ .. code-block:: bash
+
+ $VENV/bin/pytest tutorial/tests.py -q
+ ....
+ 4 passed in 0.40 seconds
+
+#. Run your Pyramid application with:
+
+ .. code-block:: bash
+
+ $VENV/bin/pserve development.ini --reload
+
+#. Open http://localhost:6543/ in your browser.
Analysis
diff --git a/docs/quick_tutorial/jinja2/setup.py b/docs/quick_tutorial/jinja2/setup.py
index a93cf6a73..86f177866 100644
--- a/docs/quick_tutorial/jinja2/setup.py
+++ b/docs/quick_tutorial/jinja2/setup.py
@@ -2,13 +2,22 @@ from setuptools import setup
requires = [
'pyramid',
+ 'pyramid_chameleon',
+ 'pyramid_debugtoolbar',
+ 'pyramid_jinja2',
'waitress',
]
setup(name='tutorial',
install_requires=requires,
+ extras_require={
+ 'test': [
+ 'pytest',
+ 'webtest',
+ ],
+ },
entry_points="""\
[paste.app_factory]
main = tutorial:main
""",
-) \ No newline at end of file
+ )