diff options
Diffstat (limited to 'docs/quick_tour.rst')
| -rw-r--r-- | docs/quick_tour.rst | 81 |
1 files changed, 70 insertions, 11 deletions
diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index fcf799c6d..cb07826cf 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -1,3 +1,5 @@ +.. _quick_tour: + ===================== Quick Tour of Pyramid ===================== @@ -30,6 +32,13 @@ area in place. For Python 3.3: We make a :term:`virtualenv` then activate it. We then get Python packaging tools installed. +.. seealso:: See Also: Python 3's :mod:`venv module <python3:venv>`, + the ``setuptools`` `installation + instructions <https://pypi.python.org/pypi/setuptools/0.9.8#installation-instructions>`_, + documentation for `pip <http://www.pip-installer.org/en/latest/>`_, + and + Pyramid's :ref:`Before You Install <installing_chapter>` + Pyramid Installation ==================== @@ -43,6 +52,8 @@ installed is easy: Our virtual environment now has the Pyramid software available to its Python. +.. seealso:: See Also: :ref:`installing_unix` + Hello World =========== @@ -80,6 +91,9 @@ in Pyramid development. Building an application from loosely-coupled parts via :doc:`../narr/configuration` is a central idea in Pyramid, one that we will revisit regurlarly in this *Quick Tour*. +.. seealso:: See Also: :ref:`firstapp_chapter` and + :ref:`Single File Tasks tutorial <tutorials:single-file-tutorial>` + Handling Web Requests and Responses =================================== @@ -108,6 +122,8 @@ the name is included in the body of the response:: Finally, we set the response's content type and return the Response. +.. seealso:: See Also: :ref:`webob_chapter` + Views ===== @@ -156,6 +172,9 @@ configuration`, in which a Python :term:`decorator` is placed on the line above the view. Both approaches result in the same final configuration, thus usually, it is simply a matter of taste. +.. seealso:: See Also: :doc:`../narr/views`, + :doc:`../narr/viewconfig`, and + :ref:`debugging_view_configuration` Routing ======= @@ -198,10 +217,9 @@ view: "replacement patterns" (the curly braces) in the route declaration. This information can then be used in your view. -As you might imagine, Pyramid provides -:doc:`many more features in routing <../narr/urldispatch>` -(route factories, custom predicates, security statements, -etc.) We will see more features later in *Geting Started*. +.. seealso:: See Also: :doc:`../narr/urldispatch`, + :ref:`debug_routematch_section`, and + :doc:`../narr/router` Templating ========== @@ -232,6 +250,10 @@ Since our view returned ``dict(name=request.matchdict['name'])``, we can use ``name`` as a variable in our template via ``${name}``. +.. seealso:: See Also: :doc:`../narr/templates`, + :ref:`debugging_templates`, and + :ref:`mako_templates` + Templating With ``jinja2`` ========================== @@ -269,11 +291,9 @@ filename extensions. In this case, changing the extension from ``.pt`` to ``.jinja2`` passed the view response through the ``pyramid_jinja2`` renderer. -.. note:: - - At the time of this writing, Jinja2 had not released a version - compatible with Python 3.3. - +.. seealso:: See Also: `Jinja2 homepage <http://jinja.pocoo.org/>`_, + and + :ref:`pyramid_jinja2 Overview <jinja2:overview>` Static Assets ============= @@ -318,6 +338,10 @@ By using ``request.static_url`` to generate the full URL to the static assets, you both ensure you stay in sync with the configuration and gain refactoring flexibility later. +.. seealso:: See Also: :doc:`../narr/assets`, + :ref:`preventing_http_caching`, and + :ref:`influencing_http_caching` + Returning JSON ============== @@ -333,6 +357,10 @@ This wires up a view that returns some data through the JSON :term:`renderer`, which calls Python's JSON support to serialize the data into JSON and set the appropriate HTTP headers. +.. seealso:: See Also: :ref:`views_which_use_a_renderer`, + :ref:`json_renderer`, and + :ref:`adding_and_overriding_renderers` + View Classes ============ @@ -374,6 +402,8 @@ Only one route needed, stated in one place atop the view class. Also, the assignment of the ``name`` is done in the ``__init__``. Our templates can then use ``{{ view.name }}``. +.. seealso:: See Also: :ref:`class_as_view` + Quick Project Startup with Scaffolds ==================================== @@ -420,6 +450,9 @@ configuration. This includes a new way of running your application: Let's look at ``pserve`` and configuration in more depth. +.. seealso:: See Also: :ref:`project_narr` and + :doc:`../narr/scaffolding` + Application Running with ``pserve`` =================================== @@ -446,6 +479,8 @@ Most of the work, though, comes from your project's wiring, as expressed in the configuration file you supply to ``pserve``. Let's take a look at this configuration file. +.. seealso:: See Also: :ref:`what_is_this_pserve_thing` + Configuration with ``.ini`` Files ================================= @@ -491,6 +526,10 @@ Additionally, the ``development.ini`` generated by this scaffold wired up Python's standard logging. We'll now see in the console, for example, a log on every request that comes in, as well traceback information. +.. seealso:: See Also: :ref:`environment_chapter` and + :doc:`../narr/paste` + + Easier Development with ``debugtoolbar`` ======================================== @@ -540,6 +579,8 @@ you want to disable this toolbar, no need to change code: you can remove it from ``pyramid.includes`` in the relevant ``.ini`` configuration file. +.. seealso:: See Also: :ref:`pyramid_debugtoolbar <toolbar:overview>` + Unit Tests and ``nose`` ======================= @@ -566,8 +607,7 @@ We changed ``setup.py`` which means we need to re-run .. code-block:: bash - $ cd hello_world - $ nosetests . + $ nosetests hello_world/tests.py . Name Stmts Miss Cover Missing --------------------------------------------------- @@ -590,6 +630,8 @@ Pyramid supplies helpers for test writing, which we use in the test setup and teardown. Our one test imports the view, makes a dummy request, and sees if the view returns what we expected. +.. seealso:: See Also: :ref:`testing_chapter` + Logging ======= @@ -631,6 +673,8 @@ visit ``http://localhost:6543`` your console will now show:: 2013-08-09 10:42:42,968 DEBUG [hello_world.views][MainThread] Some Message +.. seealso:: See Also: :ref:`logging_chapter` + Sessions ======== @@ -675,6 +719,11 @@ Jinja2 template: :start-after: Start Sphinx Include 1 :end-before: End Sphinx Include 1 +.. seealso:: See Also: + :ref:`sessions_chapter`, :ref:`flash_messages`, + :ref:`session_module`, and + `Beaker sessioning middleware + <http://docs.pylonsproject.org/projects/pyramid_beaker/en/latest/>`_ Databases ========= @@ -719,6 +768,12 @@ of the system, can then easily get at the data thanks to SQLAlchemy: :start-after: Start Sphinx Include :end-before: End Sphinx Include +.. seealso:: See Also: `SQLAlchemy <http://www.sqlalchemy.org/>`_, + :ref:`making_a_console_script`, + :ref:`bfg_sql_wiki_tutorial`, and + `Application Transactions With pyramid_tm + <http://docs.pylonsproject.org/projects/pyramid_tm/en/latest/>`_ + Forms ===== @@ -778,6 +833,10 @@ Also, the ``deform_bootstrap`` Pyramid add-on restyles the stock Deform widgets using attractive CSS from Bootstrap and more powerful widgets from Chosen. +.. seealso:: See Also: + `Deform <http://docs.pylonsproject.org/projects/deform/en/latest/>`_, + `Colander <http://docs.pylonsproject.org/projects/colander/en/latest/>`_, and + `deform_bootstrap <https://pypi.python.org/pypi/deform_bootstrap>`_ Conclusion ========== |
