top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Execute a python script with CGI ?

+1 vote
597 views

I have a python script (web service with query postgresql/postgis). Up to now, i did several test on my local laptop station (windows).

Now i want to execute this python script on our remote server (Web server : Apache;OS : Linux).

How to write a CGI template please? Can someone help me?

posted Jun 26, 2014 by Parveen

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

While you can run Python as a CGI, the recommended pattern is to use WSGI. I suggest starting here:

https://docs.python.org/2/howto/webservers.html

answer Jun 26, 2014 by Deepankar Dubey
Similar Questions
0 votes

I am working CGI project using C programming and I am reading the login detail in form input fields and when I try to submit the form with empty fields it gives me 502 Bad Gateway CGI was not in CGI/1.1 complaint.note that i am redirecting to the same page I am reading the the fields.

+1 vote

I want to set up a very simple website, and I need to know if it is necessary to use a web framework (e.g. Django) to do basic interactive operations such as receiving input from the user, looking up a database and returning some data to the user.

I know that this is exactly the purpose of web frameworks, and that they work fine. However, I read somewhere that for small projects such operations can be managed without a web framework, just by using Python with mod_python or with the CGI module. Is this correct?

Any suggestions?

+1 vote

I have apache server installed locally on my system. I have made a directory C:mywebsites as my public_web directory. The files and folders in this directory are accessible from web-browser but the cgi-bin directory is not accessible.

The cgi-bin directory is in C:mywebsites. How should I solve this problem.

...