OSDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python web server weirdness


On 2018-06-07, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> I'm following the instructions here:
>
> https://docs.python.org/3/library/http.server.html
>
>
> and running this from the command line as a regular unprivileged user:
>
> python3.5 -m http.server 8000
>
> What I expected was a directory listing of my current directory.
>
> What I got was Livejournal's front page.

Looking into the crystal ball and guessing that "got" means you
pointed a browser at "http://localhost:8000/";...

Do you have a file named "index.html" in your home directory?

https://docs.python.org/3/library/http.server.html

  If the request was mapped to a directory, the directory is checked
  for a file named index.html or index.htm (in that order). If found,
  the file?s contents are returned;

-- 
Grant Edwards               grant.b.edwards        Yow! I want another
                                  at               RE-WRITE on my CEASAR
                              gmail.com            SALAD!!