DEV Community

Oliver Bennet
Oliver Bennet

Posted on

How many of you know Python has a built-in http server ?

Python has a built-in HTTP server!

You don’t need to install or configure anything to quickly spin up a simple web server in Python. It comes with a built-in HTTP server, perfect for quick testing or file sharing on your local network.

With just a single command, you can serve files from any directory:

python -m http.server
Enter fullscreen mode Exit fullscreen mode

By default, this starts a server on port 8000, and you can access it by visiting http://localhost:8000 in your browser. You can also specify a different port, like this:

python -m http.server 8080
Enter fullscreen mode Exit fullscreen mode

This is a super handy tool for quick file serving, development, or testing static websites without needing complex web server setups!

Oliver | Graphpe | Tutorials

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay