diff options
| author | Patricio Paez <pp@pp.com.mx> | 2011-03-31 16:58:02 -0600 |
|---|---|---|
| committer | Patricio Paez <pp@pp.com.mx> | 2011-03-31 16:58:02 -0600 |
| commit | 04ecdb323383a92f00e146be87c91e0f2a7f0281 (patch) | |
| tree | fb3c085d490fbfd8d97f77a8a85a1177af365165 /docs | |
| parent | b1e277a19646ee06cd187bb3c52939d7d8fa8f5d (diff) | |
| download | pyramid-04ecdb323383a92f00e146be87c91e0f2a7f0281.tar.gz pyramid-04ecdb323383a92f00e146be87c91e0f2a7f0281.tar.bz2 pyramid-04ecdb323383a92f00e146be87c91e0f2a7f0281.zip | |
Move Viewing the Application in a Browser up
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/tutorials/wiki/definingviews.rst | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 3a0bb5bd0..233e571f1 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -293,6 +293,32 @@ 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 +==================================== + +We can finally examine our application in a +browser. The views we'll try are as follows: + +- Visiting ``http://localhost:6543/`` in a browser invokes the ``view_wiki`` + view. This always redirects to the ``view_page`` view of the ``FrontPage`` + Page resource. + +- Visiting ``http://localhost:6543/FrontPage/`` in a browser invokes + the ``view_page`` view of the front page resource. This is + because it's the *default view* (a view without a ``name``) for Page + resources. + +- Visiting ``http://localhost:6543/FrontPage/edit_page`` in a browser + invokes the edit view for the ``FrontPage`` Page resource. + +- Visiting ``http://localhost:6543/add_page/SomePageName`` in a + browser invokes the add view for a Page. + +- To generate an error, visit ``http://localhost:6543/add_page`` which + will generate an ``IndexError`` for the expression + ``request.subpath[0]``. You'll see an interactive traceback + facility provided by :term:`WebError`. + Testing the Views ================= @@ -337,29 +363,3 @@ The expected result looks something like: Ran 9 tests in 0.203s OK - -Viewing the Application in a Browser -==================================== - -Once we've completed our edits, we can finally examine our application in a -browser. The views we'll try are as follows: - -- Visiting ``http://localhost:6543/`` in a browser invokes the ``view_wiki`` - view. This always redirects to the ``view_page`` view of the ``FrontPage`` - Page resource. - -- Visiting ``http://localhost:6543/FrontPage/`` in a browser invokes - the ``view_page`` view of the front page resource. This is - because it's the *default view* (a view without a ``name``) for Page - resources. - -- Visiting ``http://localhost:6543/FrontPage/edit_page`` in a browser - invokes the edit view for the ``FrontPage`` Page resource. - -- Visiting ``http://localhost:6543/add_page/SomePageName`` in a - browser invokes the add view for a Page. - -- To generate an error, visit ``http://localhost:6543/add_page`` which - will generate an ``IndexError`` for the expression - ``request.subpath[0]``. You'll see an interactive traceback - facility provided by :term:`WebError`. |
