Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2656 #2853

Merged
merged 5 commits into from
Dec 14, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Backward Incompatibilities
(e.g. ``request.registry.settings.foo``). This was deprecated in Pyramid 1.2.
See https://github.com/Pylons/pyramid/pull/2823

- Scaffolds, documentation and tutorials now use ``listen`` option instead
of ``host`` and ``port`` to configure Waitress server.

Features
--------

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,5 @@ Contributors
- Moriyoshi Koizumi, 2016/11/20

- Mikko Ohtamaa, 2016/12/6

- Martin Frlin, 2016/12/7
3 changes: 1 addition & 2 deletions docs/narr/MyProject/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pyramid.includes =

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/narr/MyProject/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ pyramid.default_locale_name = en

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
20 changes: 11 additions & 9 deletions docs/narr/project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,22 @@ Here's sample output from a run of ``pserve`` on UNIX:

$ $VENV/bin/pserve development.ini
Starting server in PID 16208.
serving on http://127.0.0.1:6543
Serving on http://127.0.0.1:6543
Serving on http://[::1]:6543


Access is restricted such that only a browser running on the same machine as
Pyramid will be able to access your Pyramid application. However, if you want
to open access to other machines on the same network, then edit the
``development.ini`` file, and replace the ``host`` value in the
``[server:main]`` section, changing it from ``127.0.0.1`` to ``0.0.0.0``. For
example:
``development.ini`` file, and replace the ``listen`` value in the
``[server:main]`` section, changing it from ``127.0.0.1:6543 [::1]:6543`` to ``*:6543``
(this is equivalent to ``0.0.0.0:6543 [::]:6543``). For example:

.. code-block:: ini

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

Now when you use ``pserve`` to start the application, it will respond to
requests on *all* IP addresses possessed by your system, not just requests to
Expand All @@ -316,12 +317,13 @@ the case, if you use a browser running on the same system as Pyramid, it will
be able to access the application via ``http://127.0.0.1:6543/`` as well as via
``http://192.168.1.50:6543/``. However, *other people* on other computers on
the same network will also be able to visit your Pyramid application in their
browser by visiting ``http://192.168.1.50:6543/``.
browser by visiting ``http://192.168.1.50:6543/``. Same holds true if you use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar fix.

The same holds

ipv6. ``[::]`` means the same as ``0.0.0.0`` but for ipv6 protocol.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More minor grammar fixes.

IPv6. [::] means the same as 0.0.0.0, but for IPv6.


You can change the port on which the server runs on by changing the same
portion of the ``development.ini`` file. For example, you can change the
``port = 6543`` line in the ``development.ini`` file's ``[server:main]``
section to ``port = 8080`` to run the server on port 8080 instead of port 6543.
``listen = 127.0.0.1:6543 [::1]:6543`` line in the ``development.ini`` file's ``[server:main]``
section to ``listen = 127:0.0.1:8080 [::1]:8080`` to run the server on port 8080 instead of port 6543.

You can shut down a server started this way by pressing ``Ctrl-C`` (or
``Ctrl-Break`` on Windows).
Expand Down
8 changes: 5 additions & 3 deletions docs/narr/startup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ you'll see something much like this show up on the console:

$ $VENV/bin/pserve development.ini
Starting server in PID 16305.
serving on http://127.0.0.1:6543
Serving on http://127.0.0.1:6543
Serving on http://[::1]:6543

This chapter explains what happens between the time you press the "Return" key
on your keyboard after typing ``pserve development.ini`` and the time the line
Expand Down Expand Up @@ -130,8 +131,9 @@ Here's a high-level time-ordered overview of what happens when you press

#. ``pserve`` starts the WSGI *server* defined within the ``[server:main]``
section. In our case, this is the Waitress server (``use =
egg:waitress#main``), and it will listen on all interfaces (``host =
127.0.0.1``), on port number 6543 (``port = 6543``). The server code itself
egg:waitress#main``), and it will listen on all interfaces (``listen =
127.0.0.1:6543 [::1]:6543``, means that it will listen on ipv4 and ipv6),
on port number 6543. The server code itself
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar fixes. Also you no longer need to hard wrap paragraphs.

and it will listen on all interfaces on port 6543 for both IPv4 and IPv6 (listen = 127.0.0.1:6543 [::1]:6543).

is what prints ``serving on http://127.0.0.1:6543``. The server serves the
application, and the application is running, waiting to receive requests.

Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tour/package/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ pyramid.includes =

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tour/sqla_demo/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ sqlalchemy.url = sqlite:///%(here)s/sqla_demo.sqlite

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tour/sqla_demo/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ sqlalchemy.url = sqlite:///%(here)s/sqla_demo.sqlite

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tutorial/authentication/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ tutorial.secret = 98zd

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/authorization/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ tutorial.secret = 98zd

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/databases/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ sqlalchemy.url = sqlite:///%(here)s/sqltutorial.sqlite

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543

# Begin logging configuration

Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tutorial/debugtoolbar/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/forms/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/functional_testing/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/ini/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ use = egg:tutorial

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/jinja2/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/json/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/logging/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543

# Begin logging configuration

Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tutorial/more_view_classes/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/request_response/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/retail_forms/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/routing/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/scaffolds/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pyramid.includes =

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tutorial/scaffolds/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ pyramid.default_locale_name = en

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/quick_tutorial/sessions/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/static_assets/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/templating/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/unit_testing/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/view_classes/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/quick_tutorial/views/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ pyramid.includes =

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
listen = *:6543
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/authorization/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/authorization/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/basiclayout/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/basiclayout/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/installation/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/installation/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/models/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/models/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/tests/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 6543
listen = 127.0.0.1:6543 [::1]:6543

###
# logging configuration
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/wiki/src/tests/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
listen = *:6543

###
# logging configuration
Expand Down
Loading