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…


This content originally appeared on DEV Community and was authored by Oliver Bennet

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

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

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

Oliver | Graphpe | Tutorials


This content originally appeared on DEV Community and was authored by Oliver Bennet


Print Share Comment Cite Upload Translate Updates
APA

Oliver Bennet | Sciencx (2024-10-03T07:18:01+00:00) How many of you know Python has a built-in http server ?. Retrieved from https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/

MLA
" » How many of you know Python has a built-in http server ?." Oliver Bennet | Sciencx - Thursday October 3, 2024, https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/
HARVARD
Oliver Bennet | Sciencx Thursday October 3, 2024 » How many of you know Python has a built-in http server ?., viewed ,<https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/>
VANCOUVER
Oliver Bennet | Sciencx - » How many of you know Python has a built-in http server ?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/
CHICAGO
" » How many of you know Python has a built-in http server ?." Oliver Bennet | Sciencx - Accessed . https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/
IEEE
" » How many of you know Python has a built-in http server ?." Oliver Bennet | Sciencx [Online]. Available: https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/. [Accessed: ]
rf:citation
» How many of you know Python has a built-in http server ? | Oliver Bennet | Sciencx | https://www.scien.cx/2024/10/03/how-many-of-you-know-python-has-a-built-in-http-server/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.