r/programming • u/kksm19820117 • Sep 26 '09
Tech Tip: Really Simple HTTP Server with Python
http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python1
u/mdipierro Sep 26 '09
It is nice that Python comes with that but I do not think that is multi-threaded which is important for production applications. This one is and it is very fast (benchmarks are in the source code). It consists of a single file and 300 lines of code.
1
u/plain-simple-garak Sep 27 '09
SimpleHTTPServer should probably never be used for production apps, regardless of threading issues.
1
u/mdipierro Sep 27 '09
I do not know much about it. What are its limitations?
1
u/plain-simple-garak Sep 27 '09
Well I did say probably. I don't exactly know anything about it specifically. The docs say it can only handle HEAD and GET. It probably isn't optimized for performance. I think its main use is for... simple cases.
1
u/mdipierro Sep 27 '09
No POST? I wonder why they did not include something good like cherrypy's wsgiserver.
1
u/plain-simple-garak Sep 27 '09 edited Sep 27 '09
I think a good argument could be made that even having SimpleHTTPServer in the standard library is a bit excessive. A "real" webserver would be obscene.
Sure is convenient though...
1
u/contrarian Sep 26 '09
simple http server in python... import http server class.
Ok.