Zalgorithm

A basic static website for local development

The skeleton of a website for local development that serves files with the Python http.server module .

Code: https://github.com/scossar/basic_dev_site

HTTP server

Note that http.server is not recommended for production.

# http_server.py
import http.server
import socketserver
import sys

Handler = http.server.SimpleHTTPRequestHandler

PORT = 8888


def run(port: int):
    with socketserver.TCPServer(("", port), Handler) as httpd:
        print("Serving at port", port)
        httpd.serve_forever()


if __name__ == "__main__":
    port = int(sys.argv[1]) if sys.argv[1] else PORT
    run(port)

Start the server with:

python http_server <port_number>

If a port number isn’t provided it will default to port 8888.

A basic HTML page

A good enough stylesheet is loaded from /css/main.css. The styles set a max-width on div.wrap:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/css/main.css" />
    <title>Scratch</title>
  </head>
  <body>
    <div class="wrap">
      <h1>Scratch pad</h1>
      <p>This is a paragraph.</p>
    </div>
  </body>
</html>

References

Python 3.14.2 documentation. “http.server — HTTP servers.” Last updated: January 12, 2026. https://docs.python.org/3/library/http.server.html .