summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki/definingviews.rst
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2016-04-10 00:38:33 -0700
committerSteve Piercy <web@stevepiercy.com>2016-04-10 00:38:33 -0700
commitb8f5796f64100909ebe597a9534eb0ca30ed039b (patch)
tree3aed25e507794a614dabcfe78565d87ae87f9fda /docs/tutorials/wiki/definingviews.rst
parent43edd55f205edaad1d7e9d5b5d7ff349b196b0cc (diff)
downloadpyramid-b8f5796f64100909ebe597a9534eb0ca30ed039b.tar.gz
pyramid-b8f5796f64100909ebe597a9534eb0ca30ed039b.tar.bz2
pyramid-b8f5796f64100909ebe597a9534eb0ca30ed039b.zip
- update definingviews and its src files
- fix css in zodb scaffold and wiki tutorial previous steps
Diffstat (limited to 'docs/tutorials/wiki/definingviews.rst')
-rw-r--r--docs/tutorials/wiki/definingviews.rst37
1 files changed, 21 insertions, 16 deletions
diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst
index 9184c2730..94871d4ab 100644
--- a/docs/tutorials/wiki/definingviews.rst
+++ b/docs/tutorials/wiki/definingviews.rst
@@ -43,7 +43,7 @@ We need to add a dependency on the ``docutils`` package to our ``tutorial``
package's ``setup.py`` file by assigning this dependency to the ``requires``
parameter in the ``setup()`` function.
-Open ``tutorial/setup.py`` and edit it to look like the following:
+Open ``setup.py`` and edit it to look like the following:
.. literalinclude:: src/views/setup.py
:linenos:
@@ -52,40 +52,44 @@ Open ``tutorial/setup.py`` and edit it to look like the following:
Only the highlighted line needs to be added.
-Running ``setup.py develop``
+
+Running ``pip install -e .``
============================
-Since a new software dependency was added, you will need to run ``python
-setup.py develop`` again inside the root of the ``tutorial`` package to obtain
-and register the newly added dependency distribution.
+Since a new software dependency was added, you will need to run ``pip install
+-e .`` again inside the root of the ``tutorial`` package to obtain and register
+the newly added dependency distribution.
Make sure your current working directory is the root of the project (the
directory in which ``setup.py`` lives) and execute the following command.
On UNIX:
-.. code-block:: text
+.. code-block:: bash
$ cd tutorial
- $ $VENV/bin/python setup.py develop
+ $ $VENV/bin/pip install -e .
On Windows:
-.. code-block:: text
+.. code-block:: ps1con
c:\pyramidtut> cd tutorial
- c:\pyramidtut\tutorial> %VENV%\Scripts\python setup.py develop
+ c:\pyramidtut\tutorial> %VENV%\Scripts\pip install -e .
Success executing this command will end with a line to the console something
-like::
+like:
+
+.. code-block:: text
+
+ Successfully installed docutils-0.12 tutorial-0.0
- Finished processing dependencies for tutorial==0.0
Adding view functions in ``views.py``
=====================================
-It's time for a major change. Open ``tutorial/tutorial/views.py`` and edit it
-to look like the following:
+It's time for a major change. Open ``tutorial/views.py`` and edit it to look
+like the following:
.. literalinclude:: src/views/tutorial/views.py
:linenos:
@@ -312,7 +316,7 @@ extension to be recognized as such.
The ``view.pt`` template
------------------------
-Create ``tutorial/tutorial/templates/view.pt`` and add the following
+Create ``tutorial/templates/view.pt`` and add the following
content:
.. literalinclude:: src/views/tutorial/templates/view.pt
@@ -331,8 +335,7 @@ wiki page. It includes:
The ``edit.pt`` template
------------------------
-Create ``tutorial/tutorial/templates/edit.pt`` and add the following
-content:
+Create ``tutorial/templates/edit.pt`` and add the following content:
.. literalinclude:: src/views/tutorial/templates/edit.pt
:linenos:
@@ -354,6 +357,7 @@ The form POSTs back to the ``save_url`` argument supplied by the view (line
See :ref:`renderer_system_values` for information about other names that
are available by default when a template is used as a renderer.
+
Static assets
-------------
@@ -369,6 +373,7 @@ subdirectories) and are just referred to by URL or by using the convenience
method ``static_url``, e.g.,
``request.static_url('<package>:static/foo.css')`` within templates.
+
Viewing the application in a browser
====================================