1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Using Python's http.server, can I disable directory listings?

Discussão em 'Python' iniciado por Stack, Novembro 21, 2025.

  1. Stack

    Stack Membro Participativo

    If I run python -m http.server on the command line, then navigate in a browser to a directory that doesn't contain index.html, I see a directory listing (as documented here).

    A production server in this situation, however, will generally refuse to list the contents of the directory and instead return status 403 or 404. Can I configure http.server to do the same?

    Continue reading...

Compartilhe esta Página