From 71b83e5ea328b654f8463f567ecc054a55a7a90b Mon Sep 17 00:00:00 2001 From: Paul Everitt Date: Tue, 6 Aug 2013 10:12:42 -0400 Subject: Move sample code into subdirectories. Add sections for requests and views. --- docs/getting_started/about_guide.rst | 14 -- docs/getting_started/index.rst | 80 ++------- docs/getting_started/quick_glance.rst | 180 +++++++++++++-------- docs/getting_started/quick_glance/app1.py | 16 -- docs/getting_started/quick_glance/app2.py | 18 --- docs/getting_started/quick_glance/app3.jinja2 | 9 -- docs/getting_started/quick_glance/app3.py | 19 --- docs/getting_started/quick_glance/app4.jinja2 | 10 -- docs/getting_started/quick_glance/app4.py | 19 --- docs/getting_started/quick_glance/app5.py | 26 --- docs/getting_started/quick_glance/app6.py | 30 ---- .../quick_glance/hello_world/CHANGES.txt | 4 - .../quick_glance/hello_world/MANIFEST.in | 2 - .../quick_glance/hello_world/README.txt | 4 - .../quick_glance/hello_world/app.py | 16 ++ .../quick_glance/hello_world/development.ini | 52 ------ .../hello_world/hello_world/__init__.py | 23 --- .../locale/de/LC_MESSAGES/hello_world.mo | Bin 460 -> 0 bytes .../locale/de/LC_MESSAGES/hello_world.po | 21 --- .../locale/fr/LC_MESSAGES/hello_world.mo | Bin 461 -> 0 bytes .../locale/fr/LC_MESSAGES/hello_world.po | 21 --- .../hello_world/hello_world/locale/hello_world.pot | 21 --- .../quick_glance/hello_world/hello_world/models.py | 8 - .../hello_world/hello_world/static/favicon.ico | Bin 1406 -> 0 bytes .../hello_world/hello_world/static/logo.png | Bin 6641 -> 0 bytes .../hello_world/hello_world/static/pylons.css | 73 --------- .../hello_world/templates/mytemplate.jinja2 | 87 ---------- .../quick_glance/hello_world/hello_world/tests.py | 21 --- .../quick_glance/hello_world/hello_world/views.py | 6 - .../hello_world/message-extraction.ini | 3 - .../quick_glance/hello_world/setup.cfg | 28 ---- .../quick_glance/hello_world/setup.py | 39 ----- docs/getting_started/quick_glance/jinja2/app.py | 19 +++ .../quick_glance/jinja2/hello_world.jinja2 | 9 ++ docs/getting_started/quick_glance/json/app.py | 26 +++ .../quick_glance/package/CHANGES.txt | 4 + .../quick_glance/package/MANIFEST.in | 2 + .../quick_glance/package/README.txt | 4 + .../quick_glance/package/development.ini | 52 ++++++ .../quick_glance/package/hello_world/__init__.py | 23 +++ .../locale/de/LC_MESSAGES/hello_world.mo | Bin 0 -> 460 bytes .../locale/de/LC_MESSAGES/hello_world.po | 21 +++ .../locale/fr/LC_MESSAGES/hello_world.mo | Bin 0 -> 461 bytes .../locale/fr/LC_MESSAGES/hello_world.po | 21 +++ .../package/hello_world/locale/hello_world.pot | 21 +++ .../quick_glance/package/hello_world/models.py | 8 + .../package/hello_world/static/favicon.ico | Bin 0 -> 1406 bytes .../package/hello_world/static/logo.png | Bin 0 -> 6641 bytes .../package/hello_world/static/pylons.css | 73 +++++++++ .../hello_world/templates/mytemplate.jinja2 | 87 ++++++++++ .../quick_glance/package/hello_world/tests.py | 21 +++ .../quick_glance/package/hello_world/views.py | 6 + .../quick_glance/package/message-extraction.ini | 3 + .../getting_started/quick_glance/package/setup.cfg | 28 ++++ docs/getting_started/quick_glance/package/setup.py | 39 +++++ docs/getting_started/quick_glance/requests/app.py | 16 ++ docs/getting_started/quick_glance/routing/app.py | 18 +++ .../quick_glance/view_classes/app.py | 30 ++++ docs/getting_started/quick_glance/views/app.py | 10 ++ docs/getting_started/quick_glance/views/views.py | 7 + docs/getting_started/scaffolds.rst | 9 +- docs/getting_started/static_assets/app.py | 19 +++ .../static_assets/hello_world.jinja2 | 10 ++ docs/index.rst | 24 ++- 64 files changed, 753 insertions(+), 707 deletions(-) delete mode 100644 docs/getting_started/about_guide.rst delete mode 100644 docs/getting_started/quick_glance/app1.py delete mode 100644 docs/getting_started/quick_glance/app2.py delete mode 100644 docs/getting_started/quick_glance/app3.jinja2 delete mode 100644 docs/getting_started/quick_glance/app3.py delete mode 100644 docs/getting_started/quick_glance/app4.jinja2 delete mode 100644 docs/getting_started/quick_glance/app4.py delete mode 100644 docs/getting_started/quick_glance/app5.py delete mode 100644 docs/getting_started/quick_glance/app6.py delete mode 100644 docs/getting_started/quick_glance/hello_world/CHANGES.txt delete mode 100644 docs/getting_started/quick_glance/hello_world/MANIFEST.in delete mode 100644 docs/getting_started/quick_glance/hello_world/README.txt create mode 100644 docs/getting_started/quick_glance/hello_world/app.py delete mode 100644 docs/getting_started/quick_glance/hello_world/development.ini delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/__init__.py delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/models.py delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2 delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/tests.py delete mode 100644 docs/getting_started/quick_glance/hello_world/hello_world/views.py delete mode 100644 docs/getting_started/quick_glance/hello_world/message-extraction.ini delete mode 100644 docs/getting_started/quick_glance/hello_world/setup.cfg delete mode 100644 docs/getting_started/quick_glance/hello_world/setup.py create mode 100644 docs/getting_started/quick_glance/jinja2/app.py create mode 100644 docs/getting_started/quick_glance/jinja2/hello_world.jinja2 create mode 100644 docs/getting_started/quick_glance/json/app.py create mode 100644 docs/getting_started/quick_glance/package/CHANGES.txt create mode 100644 docs/getting_started/quick_glance/package/MANIFEST.in create mode 100644 docs/getting_started/quick_glance/package/README.txt create mode 100644 docs/getting_started/quick_glance/package/development.ini create mode 100644 docs/getting_started/quick_glance/package/hello_world/__init__.py create mode 100644 docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo create mode 100644 docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po create mode 100644 docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo create mode 100644 docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po create mode 100644 docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot create mode 100644 docs/getting_started/quick_glance/package/hello_world/models.py create mode 100644 docs/getting_started/quick_glance/package/hello_world/static/favicon.ico create mode 100644 docs/getting_started/quick_glance/package/hello_world/static/logo.png create mode 100644 docs/getting_started/quick_glance/package/hello_world/static/pylons.css create mode 100644 docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2 create mode 100644 docs/getting_started/quick_glance/package/hello_world/tests.py create mode 100644 docs/getting_started/quick_glance/package/hello_world/views.py create mode 100644 docs/getting_started/quick_glance/package/message-extraction.ini create mode 100644 docs/getting_started/quick_glance/package/setup.cfg create mode 100644 docs/getting_started/quick_glance/package/setup.py create mode 100644 docs/getting_started/quick_glance/requests/app.py create mode 100644 docs/getting_started/quick_glance/routing/app.py create mode 100644 docs/getting_started/quick_glance/view_classes/app.py create mode 100644 docs/getting_started/quick_glance/views/app.py create mode 100644 docs/getting_started/quick_glance/views/views.py create mode 100644 docs/getting_started/static_assets/app.py create mode 100644 docs/getting_started/static_assets/hello_world.jinja2 (limited to 'docs') diff --git a/docs/getting_started/about_guide.rst b/docs/getting_started/about_guide.rst deleted file mode 100644 index 812b07457..000000000 --- a/docs/getting_started/about_guide.rst +++ /dev/null @@ -1,14 +0,0 @@ -================ -About This Guide -================ - - -- Chapter titles are meaningful - -- Each chapter is autonomous, no one-big-application here - -- Interlinking - -- Reporting bugs or ideas - -- SO for questions \ No newline at end of file diff --git a/docs/getting_started/index.rst b/docs/getting_started/index.rst index 6396a8e6c..61964056e 100644 --- a/docs/getting_started/index.rst +++ b/docs/getting_started/index.rst @@ -4,80 +4,25 @@ Getting Started With Pyramid Welcome to Pyramid, the Python web framework that lets you start small and finish big. Whether you are new to Python web development or you're -an experienced developer that wants a quick look at the major +an experienced developer wanting a quick look at the major features, this guide provides a convenient entry point with independent chapters for each topic. -:doc:`quick_glance` -=================== - -Python web development is a very big topic. Wouldn't it be great to -have a quick overview, end-to-end, just to get oriented? This chapter -shows "a little about a lot", full of short code snippets and links to -deeper treatment of topics. Additionally, we showcase some facilities -that make Pyramid unique for "applications with ambition." - -:doc:`about_guide` -================== - -Now that we have set the scene, we explain the purpose of this guide -(and non-purpose), showing how it is organized. - - -:doc:`scaffolds` +About This Guide ================ -Pyramid projects are organized using normal Python facilities for -projects. Normal, though, is in the eye of the beholder. This chapter -shows how to use scaffolds to automate the boilerplate and quickly -start development of a new project. - -Topics: scaffolds, packaging, virtual environments - -:doc:`configuration` -==================== - - -:doc:`routes` -============= - -:doc:`views` -============ - -:doc:`templates` -================ - -:doc:`static_assets` -==================== - -:doc:`testing` -============== - -:doc:`forms` -============ - -:doc:`databases` -================ - -:doc:`security` -=============== - -:doc:`json` -=========== - - -:doc:`sessions` -=============== - -:doc:`internationalization` -=========================== - +Evaluators want to jump right into a particular topic. This *Getting +Started* guide is structured with chapter titles that focuses on a +particular aspect of web development. Each chapter is autonomous and +you don't have to follow from beginning to end. -:doc:`special_views` -==================== +By definition, each topic is covered at a high level. To make it easy +to get to in-depth treatment, the chapters provide interlinking with +the full treatment in the :ref:`html_narrative_documentation`. -:doc:`top_ten` -============== +This guide is part of the official documentation. If you find a bug, +you can report it using the same facilities as the described in the +software's :ref:`support-and-development`. Contents ======== @@ -86,7 +31,6 @@ Contents :maxdepth: 2 quick_glance - about_guide scaffolds configuration routes diff --git a/docs/getting_started/quick_glance.rst b/docs/getting_started/quick_glance.rst index da65f2e51..d58303e29 100644 --- a/docs/getting_started/quick_glance.rst +++ b/docs/getting_started/quick_glance.rst @@ -3,92 +3,141 @@ Quick Glance ============ Pyramid lets you start small and finish big. This :doc:`index` guide -walks you through many of the key features. Let's put the emphasis on -*start* by doing a quick tour through Pyramid. - -This *Quick Glance* is provides snippets instead of full examples. For -working code, see the *Getting Started* chapters on each topic. +walks you through many of Pyramid's key features. Let's put the +emphasis on *start* by doing a quick tour through Pyramid, with +snippets of code to illustrate major concepts. .. note:: Like the rest of Getting Started, we're using Python 3 in - our samples. You can too, or you can use Python 2.7. + our samples. Pyramid was one of the first (October 2011) web + frameworks to fully support Python 3. You can use Python 3 + as well for this guide, but you can also use Python 2.7. -Setup -===== +Python Setup +============ -This is just a "quick glance", so we won't kill ourselves showing -installation details. The guides fully cover each topic, -including setup. In a nutshell: +First things first: we need our Python environment in ship-shape. +Pyramid encourages standard Python development practices (virtual +environments, packaging tools, etc.) so let's get our working area in +place. For Python 3.3: .. code-block:: bash $ pyvenv-3.3 env33 $ source env33/bin/activate - $ curl -O http://python-distribute.org/distribute_setup.py - $ python3.3 ./distribute_setup.py - $ rm distribute* + $ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python $ easy_install-3.3 pip - $ pip-3.3 install pyramid -We use Python 3.3's builtin virtual environment tool ``pyvenv`` to make -an isolated Python. It is so isolated, we don't have package -installation tools! After setting those up and cleaning up, -we install Pyramid into our virtual environment. +We make a :term:`virtualenv` then activate it. We then get Python +packaging tools installed so we can use the popular ``pip`` tool for +installing packages. Normal first steps for any Python project. -.. note:: +Pyramid Installation +==================== - Note the use of ``3.3`` on many of the commands, as a way to emphasize - in this document which versions of the commands we are using. This is - optional. +We now have a standard starting point for Python. Getting Pyramid +installed is easy: +.. code-block:: bash + $ pip install pyramid -The Smallest -============ +Our virtual environment now has the Pyramid software available to its +Python. + +Hello World +=========== Microframeworks have shown that learning starts best from a very small first step. Here's a tiny application in Pyramid: -.. literalinclude:: quick_glance/app1.py +.. literalinclude:: quick_glance/hello_world/app.py + :linenos: This simple example is easy to run. Save this as ``app.py`` and run it: .. code-block:: bash - $ python3 ./app.py + $ python ./app.py -Finally, open `http://localhost:8081/ `_ in a +Next, open `http://localhost:6543/ `_ in a browser and you will see the ``Hello World!`` message. -At a high level, we wrote a Python module, which when executed, -started an HTTP server. This HTTP server ran a WSGI application with -one "view". This view handled the ``http://localhost:8081/`` URL. +New to Python web programming? If so, some lines in module merit +explanation: -More specifically: +#. *Line 10*. ``if __name__ == '__main__':`` is Python's way of + saying "Start here when running from the command line". -#. We imported an HTTP server (``make_server``), a configuration system - (``Configurator``), and a way to send HTTP responses (``Response``). +#. *Lines 11-13*. Use Pyramid's :term:`configurator` to connect + :term:`view` code to particular URL :term:`route`. -#. We made a ``hello_world`` function that returned a ``Response``. +#. *Lines 6-7*. Implement the view code that generates the + :term:`response`. -#. Our ``main`` function started the configuration, added a "route", - and then mapped that route to a "view". +#. *Lines 14-16*. Publish a :term:`WSGI` app using an HTTP server. -#. To finish, we then made a WSGI app and served it. - ``if __name__ == '__main__':`` is a standard Python technique to - execute code when it is run from the command line instead of - imported into another module. +Handling Web Requests With webob +================================ -.. note:: +Developing for the web means processing web requests. As this is a +critical part of a web application, web developers need a robust, +mature set of software for web requests. + +Pyramid has always fit nicely into the existing world of Python web +development (virtual environments, packaging, scaffolding, +first to embrace Python 3, etc.) For request handling, Pyramid turned +to the well-regarded :term:`WebOb` Python library for request and +response handling. In our example +above, Pyramid hands ``hello_world`` a ``request`` that is +:ref:`based on WebOb `. + +Let's see some features of requests and responses in action: + +.. literalinclude:: quick_glance/requests/app.py + :pyobject: hello_world + + + +Views +===== - The configuration of the route and the view are split. Other systems - let you bundle those together. Pyramid makes you do the extra step, - but for a reason: this lets you control the ordering. More on this - later. +In the example above, the ``hello_world`` function is a "view" (or more +specifically, a :term:`view callable`. Views are the primary way to +accept web requests and return responses. -Using Decorators and Matchdicts -=============================== +So far the view, its registration with the configuration, and the route +to map it to a URL are all in the same Python module as the WSGI +application launching. Let's move the views out to their own ``views +.py`` module and change the ``app.py`` to scan that module looking for +decorators that setup the views. First, our revised ``app.py``: + +.. literalinclude:: quick_glance/views/app.py + :linenos: + +We added some more routes, but we also removed the view code. +Our views, and their registrations (via decorators) are now in a module +``views.py`` which is scanned via: + +.. code-block:: python + + config.scan('views') + +Our ``views.py`` is now more self-contained: + +.. literalinclude:: quick_glance/views/views.py + :linenos: + + + +- Raise exception, redirect +- Change header +- request object +- "callable" + +Routing With Decorators and Matchdicts +====================================== Let's repeat the smallest step, but make it a little more functional and elegant by adding: @@ -101,20 +150,27 @@ and elegant by adding: Let's make update our ``app.py`` module: -.. literalinclude:: quick_glance/app2.py +.. literalinclude:: quick_glance/routing/app.py :linenos: -When you run ``python3 ./app.py`` and visit a URL such as -``http://localhost:8081/hello/amy``, the response includes ``amy`` in +When you run ``python ./app.py`` and visit a URL such as +``http://localhost:6543/hello/amy``, the response includes ``amy`` in the HTML. This module, while small, starts to show how many Pyramid applications are composed: -#. We use a decorator around the view, to put the configuration closer - to the code. +#. *Line 7*. Pyramid's configuration supports + :term:`imperative configuration`, such as the ``config.add_view`` in + the previous example. You can also use + :term:`declarative configuration`, in which a Python + :term:`decorator` is placed on the line above the view. + +#. *Line 14*. When setting up the route, mark off a section of the URL + to be data available to the view's :term:`matchdict`. + +#. *Line 15*. Tell the configurator to go look for decorators. -#. We tell the ``Configurator`` to go look for decorators. Templates ========= @@ -139,7 +195,7 @@ argument tell Pyramid to pass the response through Jinja2: .. code-block:: python - @view_config(route_name='hello', renderer="app3.jinja2") + @view_config(route_name='hello', renderer="hello_world.jinja2") def hello_world(request): return dict(name=request.matchdict['name']) @@ -170,7 +226,7 @@ Pyramid will serve some static assets. First, another call to the config.add_static_view(name='static', path='static') This tells our WSGI application to map requests under -``http://localhost:8081/static/`` to files and directories inside a +``http://localhost:6543/static/`` to files and directories inside a ``static`` directory alongside our Python module. Next, make a directory ``static`` and place ``app.css`` inside: @@ -309,7 +365,7 @@ instructions*, we need to install this as a development package: .. code-block:: bash $ cd hello_world - $ python3.3 ./setup.py develop + $ python ./setup.py develop What did we get? A top-level directory ``hello_world`` that includes some packaging files and a subdirectory ``hello_world`` that has @@ -444,7 +500,7 @@ First, change your ``setup.py`` to say: .. code-block:: bash - $ python3.3 ./setup.py develop + $ python ./setup.py develop The Python package was now installed into our environment but we haven't told our web app to use it. We can do so imperatively in code: @@ -489,7 +545,7 @@ the ``coverage`` tool which yells at us for code that isn't tested: ) We changed ``setup.py`` which means we need to re-run -``python3.3 ./setup.py develop``. We can now run all our tests: +``python ./setup.py develop``. We can now run all our tests: .. code-block:: bash @@ -626,7 +682,7 @@ scaffold! $ pcreate --scaffold alchemy hello_sqlalchemy $ cd hello_sqlalchemy - $ python3.3 setup.py develop + $ python setup.py develop We now have a working sample SQLAlchemy application with all dependencies installed. The sample project provides a console script to @@ -714,8 +770,6 @@ Authorization Notes -- Change 8081 -> 6543 - - See also, interlinking, teasers or "3 Extras" at the end of each section, links to a downloadable version of the Python module @@ -733,4 +787,4 @@ Notes - Explain and link to WSGI, Python Packages -- Richer routing \ No newline at end of file +- Richer routing diff --git a/docs/getting_started/quick_glance/app1.py b/docs/getting_started/quick_glance/app1.py deleted file mode 100644 index cffe53ecf..000000000 --- a/docs/getting_started/quick_glance/app1.py +++ /dev/null @@ -1,16 +0,0 @@ -from wsgiref.simple_server import make_server -from pyramid.config import Configurator -from pyramid.response import Response - - -def hello_world(request): - return Response('

Hello World!

') - - -if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/') - config.add_view(hello_world, route_name='hello') - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8081, app) - server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app2.py b/docs/getting_started/quick_glance/app2.py deleted file mode 100644 index 49ccd3be1..000000000 --- a/docs/getting_started/quick_glance/app2.py +++ /dev/null @@ -1,18 +0,0 @@ -from wsgiref.simple_server import make_server -from pyramid.config import Configurator -from pyramid.response import Response -from pyramid.view import view_config - - -@view_config(route_name='hello') -def hello_world(request): - return Response('

Hello %(name)s!

' % request.matchdict) - - -if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/hello/{name}') - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8081, app) - server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app3.jinja2 b/docs/getting_started/quick_glance/app3.jinja2 deleted file mode 100644 index 6d9f0cd5f..000000000 --- a/docs/getting_started/quick_glance/app3.jinja2 +++ /dev/null @@ -1,9 +0,0 @@ - - - - Quick Glance - - -

Hello {{ name }}!

- - \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app3.py b/docs/getting_started/quick_glance/app3.py deleted file mode 100644 index 549cb5f54..000000000 --- a/docs/getting_started/quick_glance/app3.py +++ /dev/null @@ -1,19 +0,0 @@ -from wsgiref.simple_server import make_server -from pyramid.config import Configurator -from pyramid.response import Response -from pyramid.view import view_config - - -@view_config(route_name='hello', renderer='app3.jinja2') -def hello_world(request): - return dict(name=request.matchdict['name']) - - -if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/hello/{name}') - config.include('pyramid_jinja2') - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8081, app) - server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app4.jinja2 b/docs/getting_started/quick_glance/app4.jinja2 deleted file mode 100644 index 3d0f28c1f..000000000 --- a/docs/getting_started/quick_glance/app4.jinja2 +++ /dev/null @@ -1,10 +0,0 @@ - - - - Quick Glance - - - -

Hello {{ name }}!

- - \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app4.py b/docs/getting_started/quick_glance/app4.py deleted file mode 100644 index 245ed0b68..000000000 --- a/docs/getting_started/quick_glance/app4.py +++ /dev/null @@ -1,19 +0,0 @@ -from wsgiref.simple_server import make_server -from pyramid.config import Configurator -from pyramid.view import view_config - - -@view_config(route_name='hello', renderer='app4.jinja2') -def hello_world(request): - return dict(name=request.matchdict['name']) - - -if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/hello/{name}') - config.add_static_view(name='static', path='static') - config.include('pyramid_jinja2') - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8081, app) - server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app5.py b/docs/getting_started/quick_glance/app5.py deleted file mode 100644 index 245a0a5ae..000000000 --- a/docs/getting_started/quick_glance/app5.py +++ /dev/null @@ -1,26 +0,0 @@ -from wsgiref.simple_server import make_server - -from pyramid.config import Configurator -from pyramid.view import view_config - - -@view_config(route_name='hello', renderer='app4.jinja2') -def hello_world(request): - return dict(name=request.matchdict['name']) - - -@view_config(route_name='hello_json', renderer='json') -def hello_json(request): - return [1, 2, 3] - - -if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/hello/{name}') - config.add_route('hello_json', 'hello.json') - config.add_static_view(name='static', path='static') - config.include('pyramid_jinja2') - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8081, app) - server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/app6.py b/docs/getting_started/quick_glance/app6.py deleted file mode 100644 index 155becc54..000000000 --- a/docs/getting_started/quick_glance/app6.py +++ /dev/null @@ -1,30 +0,0 @@ -from wsgiref.simple_server import make_server - -from pyramid.config import Configurator -from pyramid.view import view_config - - -class HelloWorldViews: - def __init__(self, request): - self.request = request - - @view_config(route_name='hello', renderer='app4.jinja2') - def hello_world(self): - return dict(name=self.request.matchdict['name']) - - - @view_config(route_name='hello_json', renderer='json') - def hello_json(self): - return [1, 2, 3] - - -if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/hello/{name}') - config.add_route('hello_json', 'hello.json') - config.add_static_view(name='static', path='static') - config.include('pyramid_jinja2') - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8081, app) - server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/hello_world/CHANGES.txt b/docs/getting_started/quick_glance/hello_world/CHANGES.txt deleted file mode 100644 index ffa255da8..000000000 --- a/docs/getting_started/quick_glance/hello_world/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version diff --git a/docs/getting_started/quick_glance/hello_world/MANIFEST.in b/docs/getting_started/quick_glance/hello_world/MANIFEST.in deleted file mode 100644 index 18fbd855c..000000000 --- a/docs/getting_started/quick_glance/hello_world/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include *.txt *.ini *.cfg *.rst -recursive-include hello_world *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml diff --git a/docs/getting_started/quick_glance/hello_world/README.txt b/docs/getting_started/quick_glance/hello_world/README.txt deleted file mode 100644 index 63aaf6fbd..000000000 --- a/docs/getting_started/quick_glance/hello_world/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -hello_world README - - - diff --git a/docs/getting_started/quick_glance/hello_world/app.py b/docs/getting_started/quick_glance/hello_world/app.py new file mode 100644 index 000000000..df5a6cf18 --- /dev/null +++ b/docs/getting_started/quick_glance/hello_world/app.py @@ -0,0 +1,16 @@ +from wsgiref.simple_server import make_server +from pyramid.config import Configurator +from pyramid.response import Response + + +def hello_world(request): + return Response('

Hello World!

') + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/') + config.add_view(hello_world, route_name='hello') + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/hello_world/development.ini b/docs/getting_started/quick_glance/hello_world/development.ini deleted file mode 100644 index 9aa5f40cf..000000000 --- a/docs/getting_started/quick_glance/hello_world/development.ini +++ /dev/null @@ -1,52 +0,0 @@ -[app:hello_world] -pyramid.includes = pyramid_debugtoolbar -use = egg:hello_world -reload_templates = true -debug_authorization = false -debug_notfound = false -debug_routematch = false -debug_templates = true -default_locale_name = en -jinja2.directories = hello_world:templates - - - -[pipeline:main] -pipeline = - hello_world - -[server:main] -use = egg:pyramid#wsgiref -host = 0.0.0.0 -port = 6543 - -# Begin logging configuration - -[loggers] -keys = root, hello_world - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = INFO -handlers = console - -[logger_hello_world] -level = DEBUG -handlers = -qualname = hello_world - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - -# End logging configuration diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/__init__.py b/docs/getting_started/quick_glance/hello_world/hello_world/__init__.py deleted file mode 100644 index 9b5753c26..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -from pyramid.config import Configurator -from pyramid_jinja2 import renderer_factory -from hello_world.models import get_root - -def main(global_config, **settings): - """ This function returns a WSGI application. - - It is usually called by the PasteDeploy framework during - ``paster serve``. - """ - settings = dict(settings) - settings.setdefault('jinja2.i18n.domain', 'hello_world') - - config = Configurator(root_factory=get_root, settings=settings) - config.add_translation_dirs('locale/') - config.include('pyramid_jinja2') - - config.add_static_view('static', 'static') - config.add_view('hello_world.views.my_view', - context='hello_world.models.MyModel', - renderer="mytemplate.jinja2") - - return config.make_wsgi_app() diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo b/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo deleted file mode 100644 index 40bf0c271..000000000 Binary files a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo and /dev/null differ diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po b/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po deleted file mode 100644 index 0df243dba..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2011 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2011. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-05-12 09:14-0330\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.6\n" - -msgid "Hello!" -msgstr "Hallo!" diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo b/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo deleted file mode 100644 index 4fc438bfe..000000000 Binary files a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo and /dev/null differ diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po b/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po deleted file mode 100644 index dc0aae5d7..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2011 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2011. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-05-12 09:14-0330\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.6\n" - -msgid "Hello!" -msgstr "Bonjour!" diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot b/docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot deleted file mode 100644 index 9c9460cb2..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2011 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2011. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-05-12 09:14-0330\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.6\n" - -msgid "Hello!" -msgstr "" diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/models.py b/docs/getting_started/quick_glance/hello_world/hello_world/models.py deleted file mode 100644 index edd361c9c..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/models.py +++ /dev/null @@ -1,8 +0,0 @@ -class MyModel(object): - pass - -root = MyModel() - - -def get_root(request): - return root diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico b/docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico deleted file mode 100644 index 71f837c9e..000000000 Binary files a/docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico and /dev/null differ diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png b/docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png deleted file mode 100644 index 88f5d9865..000000000 Binary files a/docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png and /dev/null differ diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css b/docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css deleted file mode 100644 index 42e2e320e..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css +++ /dev/null @@ -1,73 +0,0 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;/* 16px */ -vertical-align:baseline;background:transparent;} -body{line-height:1;} -ol,ul{list-style:none;} -blockquote,q{quotes:none;} -blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;} -/* remember to define focus styles! */ -:focus{outline:0;} -/* remember to highlight inserts somehow! */ -ins{text-decoration:none;} -del{text-decoration:line-through;} -/* tables still need 'cellspacing="0"' in the markup */ -table{border-collapse:collapse;border-spacing:0;} -/* restyling */ -sub{vertical-align:sub;font-size:smaller;line-height:normal;} -sup{vertical-align:super;font-size:smaller;line-height:normal;} -/* lists */ -ul,menu,dir{display:block;list-style-type:disc;margin:1em 0;padding-left:40px;} -ol{display:block;list-style-type:decimal-leading-zero;margin:1em 0;padding-left:40px;} -li{display:list-item;} -/* nested lists have no top/bottom margins */ -ul ul,ul ol,ul dir,ul menu,ul dl,ol ul,ol ol,ol dir,ol menu,ol dl,dir ul,dir ol,dir dir,dir menu,dir dl,menu ul,menu ol,menu dir,menu menu,menu dl,dl ul,dl ol,dl dir,dl menu,dl dl{margin-top:0;margin-bottom:0;} -/* 2 deep unordered lists use a circle */ -ol ul,ul ul,menu ul,dir ul,ol menu,ul menu,menu menu,dir menu,ol dir,ul dir,menu dir,dir dir{list-style-type:circle;} -/* 3 deep (or more) unordered lists use a square */ -ol ol ul,ol ul ul,ol menu ul,ol dir ul,ol ol menu,ol ul menu,ol menu menu,ol dir menu,ol ol dir,ol ul dir,ol menu dir,ol dir dir,ul ol ul,ul ul ul,ul menu ul,ul dir ul,ul ol menu,ul ul menu,ul menu menu,ul dir menu,ul ol dir,ul ul dir,ul menu dir,ul dir dir,menu ol ul,menu ul ul,menu menu ul,menu dir ul,menu ol menu,menu ul menu,menu menu menu,menu dir menu,menu ol dir,menu ul dir,menu menu dir,menu dir dir,dir ol ul,dir ul ul,dir menu ul,dir dir ul,dir ol menu,dir ul menu,dir menu menu,dir dir menu,dir ol dir,dir ul dir,dir menu dir,dir dir dir{list-style-type:square;} -.hidden{display:none;} -p{line-height:1.5em;} -h1{font-size:1.75em;/* 28px */ -line-height:1.7em;font-family:helvetica,verdana;} -h2{font-size:1.5em;/* 24px */ -line-height:1.7em;font-family:helvetica,verdana;} -h3{font-size:1.25em;/* 20px */ -line-height:1.7em;font-family:helvetica,verdana;} -h4{font-size:1em;line-height:1.7em;font-family:helvetica,verdana;} -html,body{width:100%;height:100%;} -body{margin:0;padding:0;background-color:#ffffff;position:relative;font:16px/24px "Nobile","Lucida Grande",Lucida,Verdana,sans-serif;} -a{color:#1b61d6;text-decoration:none;} -a:hover{color:#e88f00;text-decoration:underline;} -body h1, -body h2, -body h3, -body h4, -body h5, -body h6{font-family:"Nobile","Lucida Grande",Lucida,Verdana,sans-serif;font-weight:normal;color:#144fb2;font-style:normal;} -#wrap {min-height: 100%;} -#header,#footer{width:100%;color:#ffffff;height:40px;position:absolute;text-align:center;line-height:40px;overflow:hidden;font-size:12px;} -#header{background-color:#e88f00;top:0;font-size:14px;} -#footer{background-color:#000000;bottom:0;position: relative;margin-top:-40px;clear:both;} -.header,.footer{width:700px;margin-right:auto;margin-left:auto;} -.wrapper{width:100%} -#top,#bottom{width:100%;} -#top{color:#888;background-color:#eee;height:300px;border-bottom:2px solid #ddd;} -#bottom{color:#222;background-color:#ffffff;overflow:auto;padding-bottom:80px;} -.top,.bottom{width:700px;margin-right:auto;margin-left:auto;} -.top{padding-top:100px;} -.app-welcome{margin-top:25px;} -.app-name{color:#000000;font-weight:bold;} -.bottom{padding-top:50px;} -#left{width:325px;float:left;padding-right:25px;} -#right{width:325px;float:right;padding-left:25px;} -.align-left{text-align:left;} -.align-right{text-align:right;} -.align-center{text-align:center;} -ul.links{margin:0;padding:0;} -ul.links li{list-style-type:none;font-size:14px;} -form{border-style:none;} -fieldset{border-style:none;} -input{color:#222;border:1px solid #ccc;font-family:sans-serif;font-size:12px;line-height:16px;} -input[type=text]{} -input[type=submit]{background-color:#ddd;font-weight:bold;} -/*Opera Fix*/ -body:before {content:"";height:100%;float:left;width:0;margin-top:-32767px;} diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2 b/docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2 deleted file mode 100644 index 998edfe12..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2 +++ /dev/null @@ -1,87 +0,0 @@ - - - - The Pyramid Web Framework - - - - - - - - - - -
- -
-
- Logo -

- Welcome to {{project}}, an application generated by
- the Pyramid Web Framework. -

-
-
-
-
-

{% trans %}Hello!{% endtrans %}

-

Request performed with {{ request.locale_name }} locale.

-
-
-
-

Search Pyramid documentation

-
- - -
-
- -
-
-
- - - diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/tests.py b/docs/getting_started/quick_glance/hello_world/hello_world/tests.py deleted file mode 100644 index a81c29eb0..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/tests.py +++ /dev/null @@ -1,21 +0,0 @@ -import unittest -from pyramid import testing -from pyramid.i18n import TranslationStringFactory - -_ = TranslationStringFactory('hello_world') - - -class ViewTests(unittest.TestCase): - - def setUp(self): - testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from hello_world.views import my_view - request = testing.DummyRequest() - response = my_view(request) - self.assertEqual(response['project'], 'hello_world') - diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/views.py b/docs/getting_started/quick_glance/hello_world/hello_world/views.py deleted file mode 100644 index c271d45dd..000000000 --- a/docs/getting_started/quick_glance/hello_world/hello_world/views.py +++ /dev/null @@ -1,6 +0,0 @@ -from pyramid.i18n import TranslationStringFactory - -_ = TranslationStringFactory('hello_world') - -def my_view(request): - return {'project':'hello_world'} diff --git a/docs/getting_started/quick_glance/hello_world/message-extraction.ini b/docs/getting_started/quick_glance/hello_world/message-extraction.ini deleted file mode 100644 index 0c3d54bc1..000000000 --- a/docs/getting_started/quick_glance/hello_world/message-extraction.ini +++ /dev/null @@ -1,3 +0,0 @@ -[python: **.py] -[jinja2: **.jinja2] -encoding = utf-8 diff --git a/docs/getting_started/quick_glance/hello_world/setup.cfg b/docs/getting_started/quick_glance/hello_world/setup.cfg deleted file mode 100644 index 186e796fc..000000000 --- a/docs/getting_started/quick_glance/hello_world/setup.cfg +++ /dev/null @@ -1,28 +0,0 @@ -[nosetests] -match = ^test -nocapture = 1 -cover-package = hello_world -with-coverage = 1 -cover-erase = 1 - -[compile_catalog] -directory = hello_world/locale -domain = hello_world -statistics = true - -[extract_messages] -add_comments = TRANSLATORS: -output_file = hello_world/locale/hello_world.pot -width = 80 -mapping_file = message-extraction.ini - -[init_catalog] -domain = hello_world -input_file = hello_world/locale/hello_world.pot -output_dir = hello_world/locale - -[update_catalog] -domain = hello_world -input_file = hello_world/locale/hello_world.pot -output_dir = hello_world/locale -previous = true diff --git a/docs/getting_started/quick_glance/hello_world/setup.py b/docs/getting_started/quick_glance/hello_world/setup.py deleted file mode 100644 index 6269accf1..000000000 --- a/docs/getting_started/quick_glance/hello_world/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -README = open(os.path.join(here, 'README.txt')).read() -CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() - -requires = ['pyramid>=1.0.2', 'pyramid_jinja2', 'pyramid_debugtoolbar'] - -setup(name='hello_world', - version='0.0', - description='hello_world', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - "Programming Language :: Python", - "Framework :: Pylons", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(), - include_package_data=True, - zip_safe=False, - install_requires=requires, - tests_require=requires, - test_suite="hello_world", - entry_points="""\ - [paste.app_factory] - main = hello_world:main - """, - paster_plugins=['pyramid'], - extras_require={ - 'testing': ['nose', ], - } -) \ No newline at end of file diff --git a/docs/getting_started/quick_glance/jinja2/app.py b/docs/getting_started/quick_glance/jinja2/app.py new file mode 100644 index 000000000..bee50373b --- /dev/null +++ b/docs/getting_started/quick_glance/jinja2/app.py @@ -0,0 +1,19 @@ +from wsgiref.simple_server import make_server +from pyramid.config import Configurator +from pyramid.response import Response +from pyramid.view import view_config + + +@view_config(route_name='hello', renderer='app3.jinja2') +def hello_world(request): + return dict(name=request.matchdict['name']) + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/hello/{name}') + config.include('pyramid_jinja2') + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/jinja2/hello_world.jinja2 b/docs/getting_started/quick_glance/jinja2/hello_world.jinja2 new file mode 100644 index 000000000..6d9f0cd5f --- /dev/null +++ b/docs/getting_started/quick_glance/jinja2/hello_world.jinja2 @@ -0,0 +1,9 @@ + + + + Quick Glance + + +

Hello {{ name }}!

+ + \ No newline at end of file diff --git a/docs/getting_started/quick_glance/json/app.py b/docs/getting_started/quick_glance/json/app.py new file mode 100644 index 000000000..9b47fdeaf --- /dev/null +++ b/docs/getting_started/quick_glance/json/app.py @@ -0,0 +1,26 @@ +from wsgiref.simple_server import make_server + +from pyramid.config import Configurator +from pyramid.view import view_config + + +@view_config(route_name='hello', renderer='app4.jinja2') +def hello_world(request): + return dict(name=request.matchdict['name']) + + +@view_config(route_name='hello_json', renderer='json') +def hello_json(request): + return [1, 2, 3] + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/hello/{name}') + config.add_route('hello_json', 'hello.json') + config.add_static_view(name='static', path='static') + config.include('pyramid_jinja2') + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/package/CHANGES.txt b/docs/getting_started/quick_glance/package/CHANGES.txt new file mode 100644 index 000000000..ffa255da8 --- /dev/null +++ b/docs/getting_started/quick_glance/package/CHANGES.txt @@ -0,0 +1,4 @@ +0.0 +--- + +- Initial version diff --git a/docs/getting_started/quick_glance/package/MANIFEST.in b/docs/getting_started/quick_glance/package/MANIFEST.in new file mode 100644 index 000000000..18fbd855c --- /dev/null +++ b/docs/getting_started/quick_glance/package/MANIFEST.in @@ -0,0 +1,2 @@ +include *.txt *.ini *.cfg *.rst +recursive-include hello_world *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml diff --git a/docs/getting_started/quick_glance/package/README.txt b/docs/getting_started/quick_glance/package/README.txt new file mode 100644 index 000000000..63aaf6fbd --- /dev/null +++ b/docs/getting_started/quick_glance/package/README.txt @@ -0,0 +1,4 @@ +hello_world README + + + diff --git a/docs/getting_started/quick_glance/package/development.ini b/docs/getting_started/quick_glance/package/development.ini new file mode 100644 index 000000000..9aa5f40cf --- /dev/null +++ b/docs/getting_started/quick_glance/package/development.ini @@ -0,0 +1,52 @@ +[app:hello_world] +pyramid.includes = pyramid_debugtoolbar +use = egg:hello_world +reload_templates = true +debug_authorization = false +debug_notfound = false +debug_routematch = false +debug_templates = true +default_locale_name = en +jinja2.directories = hello_world:templates + + + +[pipeline:main] +pipeline = + hello_world + +[server:main] +use = egg:pyramid#wsgiref +host = 0.0.0.0 +port = 6543 + +# Begin logging configuration + +[loggers] +keys = root, hello_world + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[logger_hello_world] +level = DEBUG +handlers = +qualname = hello_world + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s + +# End logging configuration diff --git a/docs/getting_started/quick_glance/package/hello_world/__init__.py b/docs/getting_started/quick_glance/package/hello_world/__init__.py new file mode 100644 index 000000000..9b5753c26 --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/__init__.py @@ -0,0 +1,23 @@ +from pyramid.config import Configurator +from pyramid_jinja2 import renderer_factory +from hello_world.models import get_root + +def main(global_config, **settings): + """ This function returns a WSGI application. + + It is usually called by the PasteDeploy framework during + ``paster serve``. + """ + settings = dict(settings) + settings.setdefault('jinja2.i18n.domain', 'hello_world') + + config = Configurator(root_factory=get_root, settings=settings) + config.add_translation_dirs('locale/') + config.include('pyramid_jinja2') + + config.add_static_view('static', 'static') + config.add_view('hello_world.views.my_view', + context='hello_world.models.MyModel', + renderer="mytemplate.jinja2") + + return config.make_wsgi_app() diff --git a/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo new file mode 100644 index 000000000..40bf0c271 Binary files /dev/null and b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo differ diff --git a/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po new file mode 100644 index 000000000..0df243dba --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po @@ -0,0 +1,21 @@ +# Translations template for PROJECT. +# Copyright (C) 2011 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2011. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2011-05-12 09:14-0330\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +msgid "Hello!" +msgstr "Hallo!" diff --git a/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo new file mode 100644 index 000000000..4fc438bfe Binary files /dev/null and b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo differ diff --git a/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po new file mode 100644 index 000000000..dc0aae5d7 --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po @@ -0,0 +1,21 @@ +# Translations template for PROJECT. +# Copyright (C) 2011 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2011. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2011-05-12 09:14-0330\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +msgid "Hello!" +msgstr "Bonjour!" diff --git a/docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot b/docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot new file mode 100644 index 000000000..9c9460cb2 --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot @@ -0,0 +1,21 @@ +# Translations template for PROJECT. +# Copyright (C) 2011 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2011. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2011-05-12 09:14-0330\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +msgid "Hello!" +msgstr "" diff --git a/docs/getting_started/quick_glance/package/hello_world/models.py b/docs/getting_started/quick_glance/package/hello_world/models.py new file mode 100644 index 000000000..edd361c9c --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/models.py @@ -0,0 +1,8 @@ +class MyModel(object): + pass + +root = MyModel() + + +def get_root(request): + return root diff --git a/docs/getting_started/quick_glance/package/hello_world/static/favicon.ico b/docs/getting_started/quick_glance/package/hello_world/static/favicon.ico new file mode 100644 index 000000000..71f837c9e Binary files /dev/null and b/docs/getting_started/quick_glance/package/hello_world/static/favicon.ico differ diff --git a/docs/getting_started/quick_glance/package/hello_world/static/logo.png b/docs/getting_started/quick_glance/package/hello_world/static/logo.png new file mode 100644 index 000000000..88f5d9865 Binary files /dev/null and b/docs/getting_started/quick_glance/package/hello_world/static/logo.png differ diff --git a/docs/getting_started/quick_glance/package/hello_world/static/pylons.css b/docs/getting_started/quick_glance/package/hello_world/static/pylons.css new file mode 100644 index 000000000..42e2e320e --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/static/pylons.css @@ -0,0 +1,73 @@ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;/* 16px */ +vertical-align:baseline;background:transparent;} +body{line-height:1;} +ol,ul{list-style:none;} +blockquote,q{quotes:none;} +blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;} +/* remember to define focus styles! */ +:focus{outline:0;} +/* remember to highlight inserts somehow! */ +ins{text-decoration:none;} +del{text-decoration:line-through;} +/* tables still need 'cellspacing="0"' in the markup */ +table{border-collapse:collapse;border-spacing:0;} +/* restyling */ +sub{vertical-align:sub;font-size:smaller;line-height:normal;} +sup{vertical-align:super;font-size:smaller;line-height:normal;} +/* lists */ +ul,menu,dir{display:block;list-style-type:disc;margin:1em 0;padding-left:40px;} +ol{display:block;list-style-type:decimal-leading-zero;margin:1em 0;padding-left:40px;} +li{display:list-item;} +/* nested lists have no top/bottom margins */ +ul ul,ul ol,ul dir,ul menu,ul dl,ol ul,ol ol,ol dir,ol menu,ol dl,dir ul,dir ol,dir dir,dir menu,dir dl,menu ul,menu ol,menu dir,menu menu,menu dl,dl ul,dl ol,dl dir,dl menu,dl dl{margin-top:0;margin-bottom:0;} +/* 2 deep unordered lists use a circle */ +ol ul,ul ul,menu ul,dir ul,ol menu,ul menu,menu menu,dir menu,ol dir,ul dir,menu dir,dir dir{list-style-type:circle;} +/* 3 deep (or more) unordered lists use a square */ +ol ol ul,ol ul ul,ol menu ul,ol dir ul,ol ol menu,ol ul menu,ol menu menu,ol dir menu,ol ol dir,ol ul dir,ol menu dir,ol dir dir,ul ol ul,ul ul ul,ul menu ul,ul dir ul,ul ol menu,ul ul menu,ul menu menu,ul dir menu,ul ol dir,ul ul dir,ul menu dir,ul dir dir,menu ol ul,menu ul ul,menu menu ul,menu dir ul,menu ol menu,menu ul menu,menu menu menu,menu dir menu,menu ol dir,menu ul dir,menu menu dir,menu dir dir,dir ol ul,dir ul ul,dir menu ul,dir dir ul,dir ol menu,dir ul menu,dir menu menu,dir dir menu,dir ol dir,dir ul dir,dir menu dir,dir dir dir{list-style-type:square;} +.hidden{display:none;} +p{line-height:1.5em;} +h1{font-size:1.75em;/* 28px */ +line-height:1.7em;font-family:helvetica,verdana;} +h2{font-size:1.5em;/* 24px */ +line-height:1.7em;font-family:helvetica,verdana;} +h3{font-size:1.25em;/* 20px */ +line-height:1.7em;font-family:helvetica,verdana;} +h4{font-size:1em;line-height:1.7em;font-family:helvetica,verdana;} +html,body{width:100%;height:100%;} +body{margin:0;padding:0;background-color:#ffffff;position:relative;font:16px/24px "Nobile","Lucida Grande",Lucida,Verdana,sans-serif;} +a{color:#1b61d6;text-decoration:none;} +a:hover{color:#e88f00;text-decoration:underline;} +body h1, +body h2, +body h3, +body h4, +body h5, +body h6{font-family:"Nobile","Lucida Grande",Lucida,Verdana,sans-serif;font-weight:normal;color:#144fb2;font-style:normal;} +#wrap {min-height: 100%;} +#header,#footer{width:100%;color:#ffffff;height:40px;position:absolute;text-align:center;line-height:40px;overflow:hidden;font-size:12px;} +#header{background-color:#e88f00;top:0;font-size:14px;} +#footer{background-color:#000000;bottom:0;position: relative;margin-top:-40px;clear:both;} +.header,.footer{width:700px;margin-right:auto;margin-left:auto;} +.wrapper{width:100%} +#top,#bottom{width:100%;} +#top{color:#888;background-color:#eee;height:300px;border-bottom:2px solid #ddd;} +#bottom{color:#222;background-color:#ffffff;overflow:auto;padding-bottom:80px;} +.top,.bottom{width:700px;margin-right:auto;margin-left:auto;} +.top{padding-top:100px;} +.app-welcome{margin-top:25px;} +.app-name{color:#000000;font-weight:bold;} +.bottom{padding-top:50px;} +#left{width:325px;float:left;padding-right:25px;} +#right{width:325px;float:right;padding-left:25px;} +.align-left{text-align:left;} +.align-right{text-align:right;} +.align-center{text-align:center;} +ul.links{margin:0;padding:0;} +ul.links li{list-style-type:none;font-size:14px;} +form{border-style:none;} +fieldset{border-style:none;} +input{color:#222;border:1px solid #ccc;font-family:sans-serif;font-size:12px;line-height:16px;} +input[type=text]{} +input[type=submit]{background-color:#ddd;font-weight:bold;} +/*Opera Fix*/ +body:before {content:"";height:100%;float:left;width:0;margin-top:-32767px;} diff --git a/docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2 b/docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2 new file mode 100644 index 000000000..998edfe12 --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2 @@ -0,0 +1,87 @@ + + + + The Pyramid Web Framework + + + + + + + + + + +
+ +
+
+ Logo +

+ Welcome to {{project}}, an application generated by
+ the Pyramid Web Framework. +

+
+
+
+
+

{% trans %}Hello!{% endtrans %}

+

Request performed with {{ request.locale_name }} locale.

+
+
+
+

Search Pyramid documentation

+
+ + +
+
+ +
+
+
+ + + diff --git a/docs/getting_started/quick_glance/package/hello_world/tests.py b/docs/getting_started/quick_glance/package/hello_world/tests.py new file mode 100644 index 000000000..a81c29eb0 --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/tests.py @@ -0,0 +1,21 @@ +import unittest +from pyramid import testing +from pyramid.i18n import TranslationStringFactory + +_ = TranslationStringFactory('hello_world') + + +class ViewTests(unittest.TestCase): + + def setUp(self): + testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from hello_world.views import my_view + request = testing.DummyRequest() + response = my_view(request) + self.assertEqual(response['project'], 'hello_world') + diff --git a/docs/getting_started/quick_glance/package/hello_world/views.py b/docs/getting_started/quick_glance/package/hello_world/views.py new file mode 100644 index 000000000..c271d45dd --- /dev/null +++ b/docs/getting_started/quick_glance/package/hello_world/views.py @@ -0,0 +1,6 @@ +from pyramid.i18n import TranslationStringFactory + +_ = TranslationStringFactory('hello_world') + +def my_view(request): + return {'project':'hello_world'} diff --git a/docs/getting_started/quick_glance/package/message-extraction.ini b/docs/getting_started/quick_glance/package/message-extraction.ini new file mode 100644 index 000000000..0c3d54bc1 --- /dev/null +++ b/docs/getting_started/quick_glance/package/message-extraction.ini @@ -0,0 +1,3 @@ +[python: **.py] +[jinja2: **.jinja2] +encoding = utf-8 diff --git a/docs/getting_started/quick_glance/package/setup.cfg b/docs/getting_started/quick_glance/package/setup.cfg new file mode 100644 index 000000000..186e796fc --- /dev/null +++ b/docs/getting_started/quick_glance/package/setup.cfg @@ -0,0 +1,28 @@ +[nosetests] +match = ^test +nocapture = 1 +cover-package = hello_world +with-coverage = 1 +cover-erase = 1 + +[compile_catalog] +directory = hello_world/locale +domain = hello_world +statistics = true + +[extract_messages] +add_comments = TRANSLATORS: +output_file = hello_world/locale/hello_world.pot +width = 80 +mapping_file = message-extraction.ini + +[init_catalog] +domain = hello_world +input_file = hello_world/locale/hello_world.pot +output_dir = hello_world/locale + +[update_catalog] +domain = hello_world +input_file = hello_world/locale/hello_world.pot +output_dir = hello_world/locale +previous = true diff --git a/docs/getting_started/quick_glance/package/setup.py b/docs/getting_started/quick_glance/package/setup.py new file mode 100644 index 000000000..6269accf1 --- /dev/null +++ b/docs/getting_started/quick_glance/package/setup.py @@ -0,0 +1,39 @@ +import os + +from setuptools import setup, find_packages + +here = os.path.abspath(os.path.dirname(__file__)) +README = open(os.path.join(here, 'README.txt')).read() +CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() + +requires = ['pyramid>=1.0.2', 'pyramid_jinja2', 'pyramid_debugtoolbar'] + +setup(name='hello_world', + version='0.0', + description='hello_world', + long_description=README + '\n\n' + CHANGES, + classifiers=[ + "Programming Language :: Python", + "Framework :: Pylons", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", + ], + author='', + author_email='', + url='', + keywords='web pyramid pylons', + packages=find_packages(), + include_package_data=True, + zip_safe=False, + install_requires=requires, + tests_require=requires, + test_suite="hello_world", + entry_points="""\ + [paste.app_factory] + main = hello_world:main + """, + paster_plugins=['pyramid'], + extras_require={ + 'testing': ['nose', ], + } +) \ No newline at end of file diff --git a/docs/getting_started/quick_glance/requests/app.py b/docs/getting_started/quick_glance/requests/app.py new file mode 100644 index 000000000..df5a6cf18 --- /dev/null +++ b/docs/getting_started/quick_glance/requests/app.py @@ -0,0 +1,16 @@ +from wsgiref.simple_server import make_server +from pyramid.config import Configurator +from pyramid.response import Response + + +def hello_world(request): + return Response('

Hello World!

') + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/') + config.add_view(hello_world, route_name='hello') + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/routing/app.py b/docs/getting_started/quick_glance/routing/app.py new file mode 100644 index 000000000..bbae35b07 --- /dev/null +++ b/docs/getting_started/quick_glance/routing/app.py @@ -0,0 +1,18 @@ +from wsgiref.simple_server import make_server +from pyramid.config import Configurator +from pyramid.response import Response +from pyramid.view import view_config + + +@view_config(route_name='hello') +def hello_world(request): + return Response('

Hello %(name)s!

' % request.matchdict) + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/hello/{name}') + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/view_classes/app.py b/docs/getting_started/quick_glance/view_classes/app.py new file mode 100644 index 000000000..90978344b --- /dev/null +++ b/docs/getting_started/quick_glance/view_classes/app.py @@ -0,0 +1,30 @@ +from wsgiref.simple_server import make_server + +from pyramid.config import Configurator +from pyramid.view import view_config + + +class HelloWorldViews: + def __init__(self, request): + self.request = request + + @view_config(route_name='hello', renderer='app4.jinja2') + def hello_world(self): + return dict(name=self.request.matchdict['name']) + + + @view_config(route_name='hello_json', renderer='json') + def hello_json(self): + return [1, 2, 3] + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/hello/{name}') + config.add_route('hello_json', 'hello.json') + config.add_static_view(name='static', path='static') + config.include('pyramid_jinja2') + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/views/app.py b/docs/getting_started/quick_glance/views/app.py new file mode 100644 index 000000000..1e12b6581 --- /dev/null +++ b/docs/getting_started/quick_glance/views/app.py @@ -0,0 +1,10 @@ +from wsgiref.simple_server import make_server +from pyramid.config import Configurator + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/hello/{name}') + config.scan('views') + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/quick_glance/views/views.py b/docs/getting_started/quick_glance/views/views.py new file mode 100644 index 000000000..53a6a273a --- /dev/null +++ b/docs/getting_started/quick_glance/views/views.py @@ -0,0 +1,7 @@ +from pyramid.response import Response +from pyramid.view import view_config + + +@view_config(route_name='hello') +def hello_world(request): + return Response('

Hello %(name)s!

' % request.matchdict) diff --git a/docs/getting_started/scaffolds.rst b/docs/getting_started/scaffolds.rst index 437291089..af26ab6d6 100644 --- a/docs/getting_started/scaffolds.rst +++ b/docs/getting_started/scaffolds.rst @@ -1,3 +1,10 @@ ==================================== Starting New Projects With Scaffolds -==================================== \ No newline at end of file +==================================== + +Pyramid projects are organized using normal Python facilities for +projects. Normal, though, is in the eye of the beholder. This chapter +shows how to use scaffolds to automate the boilerplate and quickly +start development of a new project. + +Topics: scaffolds, packaging, virtual environments diff --git a/docs/getting_started/static_assets/app.py b/docs/getting_started/static_assets/app.py new file mode 100644 index 000000000..a0c967c47 --- /dev/null +++ b/docs/getting_started/static_assets/app.py @@ -0,0 +1,19 @@ +from wsgiref.simple_server import make_server +from pyramid.config import Configurator +from pyramid.view import view_config + + +@view_config(route_name='hello', renderer='app4.jinja2') +def hello_world(request): + return dict(name=request.matchdict['name']) + + +if __name__ == '__main__': + config = Configurator() + config.add_route('hello', '/hello/{name}') + config.add_static_view(name='static', path='static') + config.include('pyramid_jinja2') + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) + server.serve_forever() \ No newline at end of file diff --git a/docs/getting_started/static_assets/hello_world.jinja2 b/docs/getting_started/static_assets/hello_world.jinja2 new file mode 100644 index 000000000..3d0f28c1f --- /dev/null +++ b/docs/getting_started/static_assets/hello_world.jinja2 @@ -0,0 +1,10 @@ + + + + Quick Glance + + + +

Hello {{ name }}!

+ + \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 09bbb5a9a..e61fe64d4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -48,10 +48,30 @@ What's New Getting Started =============== +Quick tour of major facilities in Pyramid, including a +:doc:`getting_started/quick_glance` high-level +overview. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 getting_started/index + getting_started/quick_glance + getting_started/scaffolds + getting_started/configuration + getting_started/routes + getting_started/views + getting_started/templates + getting_started/static_assets + getting_started/testing + getting_started/forms + getting_started/databases + getting_started/security + getting_started/json + getting_started/sessions + getting_started/internationalization + getting_started/special_views + getting_started/top_ten .. _html_narrative_documentation: @@ -192,6 +212,8 @@ management. It provides facilities for wikis, calendars, manuals, searching, tagging, commenting, and file uploads. See the `KARL site `_ for download and installation details. +.. _support-and-development: + Support and Development ======================= -- cgit v1.2.3