i was going to make a simple web interface for a Python script / module I am working on. I figured to submit the form which would do 1 of 2 options. Modify a config json file and run the python script, or submit a form to the python script and execute it.
Simply put, i know when working with some other applications, Apache for example, you need to configure it such that it accepts .py files as executable. Is that the same case with SimpleHTTPServer? If so, how?
I was looking at: https://docs.python.org/2/library/simplehttpserver.html
I was also looking at BaseHTTPServer at https://docs.python.org/2/library/basehttpserver.html#BaseHTTPServer.BaseHTTPRequestHandler though nothing was jumping out at me during configuration
you can enable the CGI (Common Gateway Interface https://en.wikipedia.org/wiki/Common_Gateway_Interface ) of the SimpleHTTPServer, see the following thread How to host python cgi script with `python -m SimpleHTTPServer 8000` or `python -m CGIHTTPServer 8000`?
this is similar to get Django running ( https://en.wikipedia.org/wiki/Django_(web_framework) ) . Django is enabled using the
mod_wsgi module or FastCGI on a WSGI-compatible webserver (Apache,...).