I am going with a stream and I would recommend using a lightweight structure.
Firstly, web applications expose your server to security risks, so itβs useful to use what is supported by a more or less large community of developers (more eye boxes to fix vulnerabilities).
Also, if you want to "stay close to the language", you need some level of abstraction to control HTTP in python mode. Python is the volume level [battery included].
Some of the frameworks remain very close to the syntax, semantics, and style of python. Take a look at webpy , for example. I think this quote talks about most of the webpy related philosophy:
"Django allows you to write web applications in Django. TurboGears allows you to write web applications in TurboGears. Web.py allows you to write web applications in Python." - Adam Atlas
Another good candidate in terms of brevity and the use of "regular" python is cherrypy . On its website:
CherryPy allows developers to create web applications in much the same way as for any other object-oriented Python program. [...] Your CherryPy-based web applications are actually stand-alone Python applications that implement their own multi-threaded web server. You can deploy them wherever you can run Python applications.
source share