From 00f87f679cdd63b642675d86d073882fb8b19430 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 20 Apr 2010 21:44:52 +0200 Subject: [PATCH] flask uses 127.0.0.1 as host by default now. stupid chrome. --- docs/quickstart.rst | 17 ++--------------- flask.py | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 3d3e765f..e0f0749f 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -30,9 +30,9 @@ because this would conflict with Flask itself. :: $ python hello.py - * Running on http://localhost:5000/ + * Running on http://127.0.0.1:5000/ -Head over to `http://localhost:5000/ `_, you should +Head over to `http://127.0.0.1:5000/ `_, you should see your hello world greeting. So what did that code do? @@ -54,19 +54,6 @@ So what did that code do? 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 ---------- diff --git a/flask.py b/flask.py index 85d87a67..3fed49d0 100644 --- a/flask.py +++ b/flask.py @@ -434,7 +434,7 @@ class Flask(object): for func in self.template_context_processors: 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 :attr:`debug` flag is set the server will automatically reload for code changes and show a debugger in case an exception happened.