Browse Source

flask uses 127.0.0.1 as host by default now. stupid chrome.

pull/1638/head
Armin Ronacher 15 years ago
parent
commit
00f87f679c
  1. 17
      docs/quickstart.rst
  2. 2
      flask.py

17
docs/quickstart.rst

@ -30,9 +30,9 @@ because this would conflict with Flask itself.
:: ::
$ python hello.py $ python hello.py
* Running on http://localhost:5000/ * Running on http://127.0.0.1:5000/
Head over to `http://localhost:5000/ <http://localhost:5000/>`_, you should Head over to `http://127.0.0.1:5000/ <http://127.0.0.1:5000/>`_, you should
see your hello world greeting. see your hello world greeting.
So what did that code do? So what did that code do?
@ -54,19 +54,6 @@ So what did that code do?
To stop the server, hit control-C. To stop the server, hit control-C.
.. admonition:: Troubleshooting
The browser is unable to access the server? Sometimes this is
unfortunately caused by broken IPv6 support in your operating system,
browser or a combination. For example on Snow Leopard Google Chrome is
known to exhibit this behaviour.
If the browser does not load up the page, you can change the `app.run`
call to force IPv4 usage::
if __name__ == '__main__':
app.run(host='127.0.0.1')
Debug Mode Debug Mode
---------- ----------

2
flask.py

@ -434,7 +434,7 @@ class Flask(object):
for func in self.template_context_processors: for func in self.template_context_processors:
context.update(func()) context.update(func())
def run(self, host='localhost', port=5000, **options): def run(self, host='127.0.0.1', port=5000, **options):
"""Runs the application on a local development server. If the """Runs the application on a local development server. If the
:attr:`debug` flag is set the server will automatically reload :attr:`debug` flag is set the server will automatically reload
for code changes and show a debugger in case an exception happened. for code changes and show a debugger in case an exception happened.

Loading…
Cancel
Save