summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/designdefense.rst12
-rw-r--r--docs/index.rst1
-rw-r--r--docs/latexindex.rst1
-rw-r--r--docs/narr/advconfig.rst20
-rw-r--r--docs/narr/configuration.rst11
-rw-r--r--docs/narr/firstapp.rst24
-rw-r--r--docs/narr/hooks.rst5
-rw-r--r--docs/narr/install.rst11
-rw-r--r--docs/narr/paste.rst2
-rw-r--r--docs/narr/project.rst9
-rw-r--r--docs/tutorials/gae/index.rst231
-rw-r--r--docs/whatsnew-1.3.rst6
12 files changed, 57 insertions, 276 deletions
diff --git a/docs/designdefense.rst b/docs/designdefense.rst
index 80675ce83..59b0e5a2d 100644
--- a/docs/designdefense.rst
+++ b/docs/designdefense.rst
@@ -1628,8 +1628,8 @@ comments take into account what we've discussed in the
.. code-block:: python
:linenos:
- from pyramid.response import Response # explicit response objects, no TL
- from paste.httpserver import serve # explicitly WSGI
+ from pyramid.response import Response # explicit response, no TL
+ from wsgiref.simple_server import make_server # explicitly WSGI
def hello_world(request): # accepts a request; no request thread local reqd
# explicit response object means no response threadlocal
@@ -1640,7 +1640,8 @@ comments take into account what we've discussed in the
config = Configurator() # no global application object.
config.add_view(hello_world) # explicit non-decorator registration
app = config.make_wsgi_app() # explicitly WSGI
- serve(app, host='0.0.0.0') # explicitly WSGI
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever() # explicitly WSGI
Pyramid Doesn't Offer Pluggable Apps
------------------------------------
@@ -1736,7 +1737,7 @@ If you can understand this hello world program, you can use Pyramid:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
@@ -1747,7 +1748,8 @@ If you can understand this hello world program, you can use Pyramid:
config = Configurator()
config.add_view(hello_world)
app = config.make_wsgi_app()
- serve(app)
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
Pyramid has ~ 650 pages of documentation (printed), covering topics from the
very basic to the most advanced. *Nothing* is left undocumented, quite
diff --git a/docs/index.rst b/docs/index.rst
index 21e587992..be03448c9 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -109,7 +109,6 @@ applications to various platforms.
tutorials/wiki2/index.rst
tutorials/wiki/index.rst
tutorials/bfg/index.rst
- tutorials/gae/index.rst
tutorials/modwsgi/index.rst
Reference Material
diff --git a/docs/latexindex.rst b/docs/latexindex.rst
index 4db5b64b2..99ec2f54d 100644
--- a/docs/latexindex.rst
+++ b/docs/latexindex.rst
@@ -73,7 +73,6 @@ Tutorials
tutorials/wiki/index.rst
tutorials/wiki2/index.rst
tutorials/bfg/index.rst
- tutorials/gae/index.rst
tutorials/modwsgi/index.rst
.. _api_reference:
diff --git a/docs/narr/advconfig.rst b/docs/narr/advconfig.rst
index 3a7bf2805..5f2175d2a 100644
--- a/docs/narr/advconfig.rst
+++ b/docs/narr/advconfig.rst
@@ -27,7 +27,7 @@ configured imperatively:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
@@ -38,7 +38,8 @@ configured imperatively:
config = Configurator()
config.add_view(hello_world)
app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
When you start this application, all will be OK. However, what happens if we
try to add another view to the configuration with the same set of
@@ -47,7 +48,7 @@ try to add another view to the configuration with the same set of
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
@@ -66,7 +67,8 @@ try to add another view to the configuration with the same set of
config.add_view(goodbye_world, name='hello')
app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
The application now has two conflicting view configuration statements. When
we try to start it again, it won't start. Instead, we'll receive a traceback
@@ -170,7 +172,7 @@ application that generates conflicts:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
@@ -189,7 +191,8 @@ application that generates conflicts:
config.add_view(goodbye_world, name='hello')
app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
We can prevent the two ``add_view`` calls from conflicting by issuing a call
to :meth:`~pyramid.config.Configurator.commit` between them:
@@ -197,7 +200,7 @@ to :meth:`~pyramid.config.Configurator.commit` between them:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
@@ -218,7 +221,8 @@ to :meth:`~pyramid.config.Configurator.commit` between them:
config.add_view(goodbye_world, name='hello')
app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
In the above example we've issued a call to
:meth:`~pyramid.config.Configurator.commit` between the two ``add_view``
diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst
index 597d48b09..37122e382 100644
--- a/docs/narr/configuration.rst
+++ b/docs/narr/configuration.rst
@@ -36,7 +36,7 @@ applications, configured imperatively:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
@@ -46,8 +46,8 @@ applications, configured imperatively:
if __name__ == '__main__':
config = Configurator()
config.add_view(hello_world)
- app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
We won't talk much about what this application does yet. Just note that the
"configuration' statements take place underneath the ``if __name__ ==
@@ -105,7 +105,7 @@ in a package and its subpackages. For example:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.response import Response
from pyramid.view import view_config
@@ -118,7 +118,8 @@ in a package and its subpackages. For example:
config = Configurator()
config.scan()
app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
The scanning machinery imports each module and subpackage in a package or
module recursively, looking for special attributes attached to objects
diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst
index c082f616b..922b0ea82 100644
--- a/docs/narr/firstapp.rst
+++ b/docs/narr/firstapp.rst
@@ -54,9 +54,8 @@ The script imports the :class:`~pyramid.config.Configurator` class from the
Like many other Python web frameworks, :app:`Pyramid` uses the :term:`WSGI`
protocol to connect an application and a web server together. The
-:mod:`paste.httpserver` server is used in this example as a WSGI server for
-convenience, as the ``paste`` package is a dependency of :app:`Pyramid`
-itself.
+:mod:`wsgiref` server is used in this example as a WSGI server for
+convenience, as it is shipped within the Python standard library.
The script also imports the :class:`pyramid.response.Response` class for
later use. An instance of this class will be used to create a web response.
@@ -205,14 +204,17 @@ WSGI Application Serving
:lines: 13
Finally, we actually serve the application to requestors by starting up a
-WSGI server. We happen to use the :func:`paste.httpserver.serve` WSGI server
-runner, passing it the ``app`` object (a :term:`router`) as the application
-we wish to serve. We also pass in an argument ``host='0.0.0.0'``, meaning
-"listen on all TCP interfaces." By default, the HTTP server listens
-only on the ``127.0.0.1`` interface, which is problematic if you're running
-the server on a remote system and you wish to access it with a web browser
-from a local system. We don't specify a TCP port number to listen on; this
-means we want to use the default TCP port, which is 8080.
+WSGI server. We happen to use the :mod:`wsgiref` ``make_server`` server
+maker for this purpose. We pass in as the first argument ``'0.0.0.0'``,
+which means "listen on all TCP interfaces." By default, the HTTP server
+listens only on the ``127.0.0.1`` interface, which is problematic if you're
+running the server on a remote system and you wish to access it with a web
+browser from a local system. We also specify a TCP port number to listen on,
+which is 8080, passing it as the second argument. The final argument ios ,
+passing it the ``app`` object (a :term:`router`), which is the the
+application we wish to serve. Finally, we call the server's
+``serve_forever`` method, which starts the main loop in which it will wait
+for requests from the outside world.
When this line is invoked, it causes the server to start listening on TCP
port 8080. The server will serve requests forever, or at least until we stop
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index a1ed6c7ff..fd6544416 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -812,7 +812,7 @@ performed, enabling you to set up the utility in advance:
.. code-block:: python
:linenos:
- from paste.httpserver import serve
+ from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from mypackage.interfaces import IMyUtility
@@ -831,7 +831,8 @@ performed, enabling you to set up the utility in advance:
config.registry.registerUtility(UtilityImplementation())
config.scan()
app = config.make_wsgi_app()
- serve(app, host='0.0.0.0')
+ server = make_server('0.0.0.0', 8080, app)
+ server.serve_forever()
For full details, please read the `Venusian documentation
<http://docs.repoze.org/venusian>`_.
diff --git a/docs/narr/install.rst b/docs/narr/install.rst
index 3de4d6e27..172cfd6d3 100644
--- a/docs/narr/install.rst
+++ b/docs/narr/install.rst
@@ -20,7 +20,7 @@ run :app:`Pyramid`.
:app:`Pyramid` is known to run on all popular UNIX-like systems such as
Linux, MacOS X, and FreeBSD as well as on Windows platforms. It is also
-known to run on Google's App Engine, and :term:`PyPy` (1.6+).
+known to run on :term:`PyPy` (1.6+).
:app:`Pyramid` installation does not require the compilation of any
C code, so you need only a Python interpreter that meets the
@@ -315,15 +315,6 @@ Installing :app:`Pyramid` on a Windows System
c:\env> Scripts\easy_install pyramid
-.. index::
- single: installing on Google App Engine
-
-Installing :app:`Pyramid` on Google App Engine
--------------------------------------------------
-
-:ref:`appengine_tutorial` documents the steps required to install a
-:app:`Pyramid` application on Google App Engine.
-
What Gets Installed
-------------------
diff --git a/docs/narr/paste.rst b/docs/narr/paste.rst
index cf8f96c8a..86b047aec 100644
--- a/docs/narr/paste.rst
+++ b/docs/narr/paste.rst
@@ -17,7 +17,7 @@ a Pyramid application that doesn't use PasteDeploy in
:ref:`firstapp_chapter`. However, all Pyramid scaffolds render PasteDeploy
configuration files, to provide new developers with a standardized way of
setting deployment values, and to provide new users with a standardized way
-of starting, stopping, and debugging an application.
+of starting, stopping, and debugging an application.
This chapter is not a replacement for documentation about PasteDeploy; it
only contextualizes the use of PasteDeploy within Pyramid. For detailed
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index af8714573..0c12d97e6 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -283,7 +283,7 @@ For example, on UNIX:
$ ../bin/pserve development.ini --reload
Starting subprocess with file monitor
Starting server in PID 16601.
- serving on 0.0.0.0:6543 view at http://127.0.0.1:6543
+ Starting HTTP server on http://0.0.0.0:6543
For more detailed information about the startup process, see
:ref:`startup_chapter`. For more information about environment variables and
@@ -909,6 +909,13 @@ one of the following.
compatible. You'll need to ``easy_install CherryPy`` into your Pyramid
virtualenv for this server to work.
+The servers described above are typically both faster and more secure than
+the default WSGI server used by Pyramid. Pyramid does not depend on either
+because Paste doesn't run on Python 3 (and Pyramid must) and the CherryPy
+server is not distributed separately from the CherryPy web framework (and it
+would be an awkward dependency to have a web framework rely on another web
+framework for just its server component).
+
``pserve`` is by no means the only way to start up and serve a :app:`Pyramid`
application. As we saw in :ref:`firstapp_chapter`, ``pserve`` needn't be
invoked at all to run a :app:`Pyramid` application. The use of ``pserve`` to
diff --git a/docs/tutorials/gae/index.rst b/docs/tutorials/gae/index.rst
deleted file mode 100644
index 3bd739480..000000000
--- a/docs/tutorials/gae/index.rst
+++ /dev/null
@@ -1,231 +0,0 @@
-.. _appengine_tutorial:
-
-Running :app:`Pyramid` on Google's App Engine
-================================================
-
-It is possible to run a :app:`Pyramid` application on Google's `App
-Engine <http://code.google.com/appengine/>`_. Content from this
-tutorial was contributed by YoungKing, based on the
-`"appengine-monkey" tutorial for Pylons
-<http://code.google.com/p/appengine-monkey/wiki/Pylons>`_. This
-tutorial is written in terms of using the command line on a UNIX
-system; it should be possible to perform similar actions on a Windows
-system.
-
-#. Download Google's `App Engine SDK
- <http://code.google.com/appengine/downloads.html>`_ and install it
- on your system.
-
-#. Use Subversion to check out the source code for
- ``appengine-monkey``.
-
- .. code-block:: text
-
- $ svn co http://appengine-monkey.googlecode.com/svn/trunk/ \
- appengine-monkey
-
-#. Use ``appengine_homedir.py`` script in ``appengine-monkey`` to
- create a :term:`virtualenv` for your application.
-
- .. code-block:: text
-
- $ export GAE_PATH=/usr/local/google_appengine
- $ python2.5 /path/to/appengine-monkey/appengine-homedir.py --gae \
- $GAE_PATH pyramidapp
-
- Note that ``$GAE_PATH`` should be the path where you have unpacked
- the App Engine SDK. (On Mac OS X at least,
- ``/usr/local/google_appengine`` is indeed where the installer puts
- it).
-
- This will set up an environment in ``pyramidapp/``, with some tools
- installed in ``pyramidapp/bin``. There will also be a directory
- ``pyramidapp/app/`` which is the directory you will upload to
- appengine.
-
-#. Install :app:`Pyramid` into the virtualenv
-
- .. code-block:: text
-
- $ cd pyramidapp/
- $ bin/easy_install pyramid
-
- This will install :app:`Pyramid` in the environment.
-
-#. Create your application
-
- We'll use the standard way to create a :app:`Pyramid`
- application, but we'll have to move some files around when we are
- done. The below commands assume your current working directory is
- the ``pyramidapp`` virtualenv directory you created in the third step
- above:
-
- .. code-block:: text
-
- $ cd app
- $ rm -rf pyramidapp
- $ bin/pcreate -s starter pyramidapp
- $ mv pyramidapp aside
- $ mv aside/pyramidapp .
- $ rm -rf aside
-
-#. Edit ``config.py``
-
- Edit the ``APP_NAME`` and ``APP_ARGS`` settings within
- ``config.py``. The ``APP_NAME`` must be ``pyramidapp:main``, and
- the APP_ARGS must be ``({},)``. Any other settings in
- ``config.py`` should remain the same.
-
- .. code-block:: python
-
- APP_NAME = 'pyramidapp:main'
- APP_ARGS = ({},)
-
-#. Edit ``runner.py``
-
- To prevent errors for ``import site``, add this code stanza before
- ``import site`` in app/runner.py:
-
- .. code-block:: python
-
- import sys
- sys.path = [path for path in sys.path if 'site-packages' not in path]
- import site
-
- You will also need to comment out the line that starts with
- ``assert sys.path`` in the file.
-
- .. code-block:: python
-
- # comment the sys.path assertion out
- # assert sys.path[:len(cur_sys_path)] == cur_sys_path, (
- # "addsitedir() caused entries to be prepended to sys.path")
-
- For GAE development environment 1.3.0 or better, you will also need
- the following somewhere near the top of the ``runner.py`` file to
- fix a compatibility issue with ``appengine-monkey``:
-
- .. code-block:: python
-
- import os
- os.mkdir = None
-
-#. Run the application. ``dev_appserver.py`` is typically installed
- by the SDK in the global path but you need to be sure to run it
- with Python 2.5 (or whatever version of Python your GAE SDK
- expects).
-
- .. code-block:: text
- :linenos:
-
- $ cd ../..
- $ python2.5 /usr/local/bin/dev_appserver.py pyramidapp/app/
-
- Startup success looks something like this:
-
- .. code-block:: text
-
- [chrism@vitaminf pyramid_gae]$ python2.5 \
- /usr/local/bin/dev_appserver.py \
- pyramidapp/app/
- INFO 2009-05-03 22:23:13,887 appengine_rpc.py:157] # ... more...
- Running application pyramidapp on port 8080: http://localhost:8080
-
- You may need to run "Make Symlinks" from the Google App Engine
- Launcher GUI application if your system doesn't already have the
- ``dev_appserver.py`` script sitting around somewhere.
-
-#. Hack on your pyramid application, using a normal run, debug, restart
- process. For tips on how to use the ``pdb`` module within Google
- App Engine, `see this blog post
- <http://jjinux.blogspot.com/2008/05/python-debugging-google-app-engine-apps.html>`_.
- In particular, you can create a function like so and call it to
- drop your console into a pdb trace:
-
- .. code-block:: python
- :linenos:
-
- def set_trace():
- import pdb, sys
- debugger = pdb.Pdb(stdin=sys.__stdin__,
- stdout=sys.__stdout__)
- debugger.set_trace(sys._getframe().f_back)
-
-#. `Sign up for a GAE account <http://code.google.com/appengine/>`_
- and create an application. You'll need a mobile phone to accept an
- SMS in order to receive authorization.
-
-#. Edit the application's ID in ``app.yaml`` to match the application
- name you created during GAE account setup.
-
- .. code-block:: yaml
-
- application: mycoolpyramidapp
-
-#. Upload the application
-
- .. code-block:: text
-
- $ python2.5 /usr/local/bin/appcfg.py update pyramidapp/app
-
- You almost certainly won't hit the 3000-file GAE file number limit
- when invoking this command. If you do, however, it will look like
- so:
-
- .. code-block:: text
-
- HTTPError: HTTP Error 400: Bad Request
- Rolling back the update.
- Error 400: --- begin server output ---
- Max number of files and blobs is 3000.
- --- end server output ---
-
- If you do experience this error, you will be able to get around
- this by zipping libraries. You can use ``pip`` to create zipfiles
- from packages. See :ref:`pip_zip` for more information about this.
-
- A successful upload looks like so:
-
- .. code-block:: text
-
- [chrism@vitaminf pyramidapp]$ python2.5 /usr/local/bin/appcfg.py \
- update ../pyramidapp/app/
- Scanning files on local disk.
- Scanned 500 files.
- # ... more output ...
- Will check again in 16 seconds.
- Checking if new version is ready to serve.
- Closing update: new version is ready to start serving.
- Uploading index definitions.
-
-#. Visit ``http://<yourapp>.appspot.com`` in a browser.
-
-.. _pip_zip:
-
-Zipping Files Via Pip
----------------------
-
-If you hit the Google App Engine 3000-file limit, you may need to
-create zipfile archives out of some distributions installed in your
-application's virtualenv.
-
-First, see which packages are available for zipping:
-
-.. code-block:: text
-
- $ bin/pip zip -l
-
-This shows your zipped packages (by default, none) and your unzipped
-packages. You can zip a package like so:
-
-.. code-block:: text
-
- $ bin/pip zip pytz-2009g-py2.5.egg
-
-Note that it requires the whole egg file name. For a :app:`Pyramid` app, the
-following packages are good candidates to be zipped.
-
-- Chameleon
-- zope.i18n
-
-Once the zipping procedure is finished you can try uploading again.
diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst
index 8dd3c3cdb..b61893536 100644
--- a/docs/whatsnew-1.3.rst
+++ b/docs/whatsnew-1.3.rst
@@ -302,6 +302,12 @@ Documentation Enhancements
- Added a section to the "Command-Line Pyramid" chapter named
:ref:`making_a_console_script`.
+- Removed the "Running Pyramid on Google App Engine" tutorial from the main
+ docs. It survives on in the Cookbook
+ (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/gae.html).
+ Rationale: it provides the correct info for the Python 2.5 version of GAE
+ only, and this version of Pyramid does not support Python 2.5.
+
Dependency Changes
------------------