Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51385

Re: Configuraion to run pyhton script on ubuntu 12.04

From Pierre Jaury <pierre@jaury.eu>
Newsgroups comp.lang.python
Subject Re: Configuraion to run pyhton script on ubuntu 12.04
Date 2013-07-28 13:34 +0200
Organization Franciliens.net, FAI associatif et local
Message-ID <87r4ei5358.fsf@silissia.kaiyou.fr> (permalink)
References <2ebe3375-6aa6-45cd-b534-0241bd025eb3@googlegroups.com>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Jaiky <jaiprakashsingh213@gmail.com> writes:

> want to run a python script which contains simple form of html on firefox browser ,  but dont know what should be the configuration on ubuntu 12.04  to run this script  i.e cgi configuration 
>
>
>
> My code is 
> ubder 
> in /var/www/cgi-bin/forms__.py
>
>
>
> #!/usr/bin/env python
> import webapp2
>
> form ="""
>   <form action="//www.google.com/search">
>     <input name="q">
>     <input type="submit">
>   </form>"""
>
>
> class MainPage(webapp2.RequestHandler):
>     def get(self):
>         #self.response.headers['Content-Type'] = 'text/plain'
>         self.response.out.write(form)
>
> app = webapp2.WSGIApplication([('/', MainPage)],
>                              debug=True)

In order for you app to run as cgi, you would have to call the webapp2
run() function. Otherwise, it is going to implement wsgi interfaces.

Have a look at:
http://webapp-improved.appspot.com/api/webapp2.html#webapp2.WSGIApplication.run

As well as:
http://httpd.apache.org/docs/current/mod/mod_alias.html#scriptalias

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Configuraion to run pyhton script on ubuntu 12.04 Jaiky <jaiprakashsingh213@gmail.com> - 2013-07-28 03:32 -0700
  Re: Configuraion to run pyhton script on ubuntu 12.04 Pierre Jaury <pierre@jaury.eu> - 2013-07-28 13:34 +0200
    Re: Configuraion to run pyhton script on ubuntu 12.04 Jaiky <jaiprakashsingh213@gmail.com> - 2013-07-28 09:19 -0700
  Re: Configuraion to run pyhton script on ubuntu 12.04 Jaiky <jaiprakashsingh213@gmail.com> - 2013-07-29 03:44 -0700

csiph-web