Skip to content
Myr

The default run method is now accepting the port from the SERVER_NAME.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 05479eb · Browse files · 2 files+13 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−2 removed

  • other:+13 added−2 removed

2 files+13 added−2 removed

modified:flask/app.py+11 added-2 removed
737 unmodified lines
738 Setting ``use_debugger`` to `True` without being in debug mode739 won't catch any exceptions because there won't be any to740 catch.741742 .. versionchanged:: 0.10743 The default port is now picked from the ``SEVER_NAME`` variable.744745 :param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to746 have the server available externally as well. Defaults to747 ``'127.0.0.1'``.745 :param port: the port of the webserver. Defaults to ``5000``.748 :param port: the port of the webserver. Defaults to ``5000`` or the749 port defined in the ``SERVER_NAME`` config variable if750 present.751 :param debug: if given, enable or disable debug mode.752 See :attr:`debug`.753 :param options: the options to be forwarded to the underlying754 Werkzeug server. See
3 unmodified lines
758 from werkzeug.serving import run_simple759 if host is None:760 host = '127.0.0.1'761 if port is None:762 server_name = self.config['SERVER_NAME']763 if server_name and ':' in server_name:764 port = int(server_name.rsplit(':', 1)[1])765 else:757 port = 5000766 port = 5000767 if debug is not None:768 self.debug = bool(debug)769 options.setdefault('use_reloader', self.debug)770 options.setdefault('use_debugger', self.debug)
1074 unmodified lines
modified:CHANGES+2 added
69 unmodified lines
70- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.71- Flask now orders JSON keys by default to not trash HTTP caches due to72 different hash seeds between different workers.73- Added `appcontext_pushed` and `appcontext_popped` signals.74- The builtin run method now takes the ``SERVER_NAME`` into account when75 picking the default port to run on.7677Version 0.978-----------79
365 unmodified lines