diff options
| author | Steve Piercy <web@stevepiercy.com> | 2018-10-07 04:41:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-07 04:41:28 -0700 |
| commit | 410a11a1d448c772ca1a5a4ec4a3946e0f88d20a (patch) | |
| tree | 41a92ddaa647d13d61da2ecff900789f3667f636 /docs/quick_tutorial/jinja2.rst | |
| parent | d4c95cb20f6332b05513910bdd661b4032c38b7c (diff) | |
| parent | ce0bfcd21b0c0bd9a082f8f98c6db7cfa24b8bfe (diff) | |
| download | pyramid-410a11a1d448c772ca1a5a4ec4a3946e0f88d20a.tar.gz pyramid-410a11a1d448c772ca1a5a4ec4a3946e0f88d20a.tar.bz2 pyramid-410a11a1d448c772ca1a5a4ec4a3946e0f88d20a.zip | |
Merge pull request #3379 from stevepiercy/docs-quick-tutorial-update
Docs quick tutorial update
Diffstat (limited to 'docs/quick_tutorial/jinja2.rst')
| -rw-r--r-- | docs/quick_tutorial/jinja2.rst | 58 |
1 files changed, 34 insertions, 24 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 |
