I want to serve static files with Python. Is the Python 3 http.server
suitable for use in production? If not, why not? And what are my alternatives?
Quoting documentation https://docs.python.org/3/library/http.server.html#module-http.server
Warning: http.server is not recommended for production. It only implements basic security checks.
First of all you don't need python at all to serve static files. Just use a real HTTP Server like Apache or NGinx. If you want a quick solution just look for a docker container with a pre-configured image suitable for your needs. Here is the NGinx. Definitely docker is a must have tool that you will not regret to learn.
$ docker run --name mysite-nginx -v /mysite:/usr/share/nginx/html:ro -p 80:80 -d nginx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With