Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107179

Re: how to setup for localhost:8000

From Monte Milanuk <memilanuk@gmail.com>
Newsgroups comp.lang.python
Subject Re: how to setup for localhost:8000
Date 2016-04-17 09:27 -0700
Message-ID <mailman.103.1460910452.6324.python-list@python.org> (permalink)
References (2 earlier) <mailman.112.1460658199.15650.python-list@python.org> <2e597a56-00ab-4370-b337-667f34eac56a@googlegroups.com> <a5cbb46c-8d7d-482f-a608-57ba48e2df40@googlegroups.com> <67abca1d-8ac5-4a9a-825d-3aa76d9ccf3f@googlegroups.com> <nf0dhb$i4b$1@ger.gmane.org>

Show all headers | View raw


On 2016-04-16 15:35, wrh8609@gmail.com wrote:

>> When you type http://localhost:8000, do you see something in the
>> console after the line  "Serving HTTP on 0.0.0.0 port 8000 ..." ?
>>
>> If the server actually serves requests on port 8000 you should see
>> a log message such as
>>
>> 127.0.0.1 - - [15/Apr/2016 20:57:32] "GET / HTTP/1.1" 200 -
> Hi Pierre,
>
> When I type http://localhost:8000, I did not see anything in the
> console after the line "Serving HTTP on 0.0.0.0 port 8000 ... I
> believe the way I ran was not correct as shown below:
>> python -m http.server
> Serving HTTP on 0.0.0.0 port 8000 ...
>
> Also if I use internet Explorer, it shows HTTP 404 errors. Do you
> think the way I am doing of the localhost:8000 setting was not
> correct?
>

Do you have any anti-virus programs running?  Its possible they may be 
interfering with letting your python installation open a server on the 
local host at all, or with letting your browser access it, if it is running.

What I get in the console looks like this:

Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS C:\Users\Monte Milanuk> python -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...

...and then once I open a browser window to 'localhost:8000', I get the 
following in the console:

127.0.0.1 - - [17/Apr/2016 09:21:49] "GET / HTTP/1.1" 200 -

Which is the python http.server telling you that it responded to a 
request from 127.0.0.1, completion code (200), etc.  If you're not 
seeing that, and you're instead getting 404 codes in the browswer 
window, something on your machine is blocking it from seeing the server.

You might try '127.0.0.1:8000' instead of 'localhost:8000' in the 
browser window, or you might try specifying different interface or port 
numbers for the server when you start it.  It *should* 'just work' as 
is, with the basic 'python -m http.server' command, but obviously it 
isn't, for whatever reason.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to setup for localhost:8000 wrh8609@gmail.com - 2016-04-14 10:46 -0700
  Re: how to setup for localhost:8000 Peter Otten <__peter__@web.de> - 2016-04-14 20:07 +0200
  Re: how to setup for localhost:8000 Andrew Farrell <armorsmith42@gmail.com> - 2016-04-14 13:06 -0500
    Re: how to setup for localhost:8000 wrh8609@gmail.com - 2016-04-14 13:50 -0700
      RE: how to setup for localhost:8000 Dan Strohl <D.Strohl@F5.com> - 2016-04-14 21:14 +0000
      Re: how to setup for localhost:8000 Pierre Quentel <pierre.quentel@gmail.com> - 2016-04-15 12:03 -0700
        Re: how to setup for localhost:8000 wrh8609@gmail.com - 2016-04-16 15:35 -0700
          Re: how to setup for localhost:8000 Monte Milanuk <memilanuk@gmail.com> - 2016-04-17 09:27 -0700
          Re: how to setup for localhost:8000 Pierre Quentel <pierre.quentel@gmail.com> - 2016-04-17 10:11 -0700
            Re: how to setup for localhost:8000 wrh8609@gmail.com - 2016-04-22 14:41 -0700
  Re: how to setup for localhost:8000 Random832 <random832@fastmail.com> - 2016-04-14 14:36 -0400
  Re: how to setup for localhost:8000 Chris Angelico <rosuav@gmail.com> - 2016-04-15 04:39 +1000
  Re: how to setup for localhost:8000 Vito De Tullio <vito.detullio@gmail.com> - 2016-04-15 07:59 +0200
  Re: how to setup for localhost:8000 Chris Angelico <rosuav@gmail.com> - 2016-04-15 17:38 +1000

csiph-web