How can i do python form post request?

gmspro gmspro at
Tue Jul 3 14:32:40 CEST 2012


>First, you need to tell the web server to execute your Python script.
What you do next depends on how you've done that.

>The simplest way is probably to pub in your cgi-bin directory. This
could be in /var/www/cgi-bin or elsewhere, like /usr/lib/cgi-bin. You
may need to enable CGI, check the relevant documentation (or with the

>When you've made sure the script is executed as a CGI script, you can
use the cgi module to get all the information you need.

>A better way to write web applications in Python is with WSGI. You can
run WSGI scripts in a number of ways, including CGI and other, more
efficient ways that integrate with the web server. Maybe somebody else
knows of a good tutorial on WSGI that they'll link here, otherwise, I'm
sure Google is your friend.

I don't want to use CGI, i followed this example, this works fine,

But the html is embeded there. But i want html form as a seperate file. How can i do it?
<form action="" method="post">
 <input type="text" id="id_text" name="name_text" />
 <input type="submit" id="id_submit" name="name_submit" />

Typing text when i click the submit button, browser prompts me to download the file.
That's not what i want. I want to execute the file after click. Is it possible in WSGI.

I have installed: libapache2-mod-wsgi

Any answer will be highly appreciate.
Thanks in advanced.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list