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


Groups > comp.lang.python > #51442

AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59

X-Received by 10.224.64.202 with SMTP id f10mr60397234qai.2.1375102520169; Mon, 29 Jul 2013 05:55:20 -0700 (PDT)
X-Received by 10.50.83.33 with SMTP id n1mr446836igy.3.1375102520136; Mon, 29 Jul 2013 05:55:20 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!cb17no995227qab.0!news-out.google.com!ce7ni0qab.0!nntp.google.com!cb17no1074285qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Mon, 29 Jul 2013 05:55:19 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=106.204.30.244; posting-account=kJjq3QoAAADiAI4EyAdJgV_r0B7eXDeS
NNTP-Posting-Host 106.204.30.244
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <2cfddec4-58bf-4694-8ac4-de4f4768bc50@googlegroups.com> (permalink)
Subject AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59
From Jaiky <jaiprakashsingh213@gmail.com>
Injection-Date Mon, 29 Jul 2013 12:55:20 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:51442

Show key headers only | View raw


learning  web concpt in python 


wrote code in /usr/lib/cgi-bin/hello_world.py

###########################################################################
#!/usr/bin/env python

import webapp2


form ="""
    <form action="http://www/google.com/search">
      <input name="q">
      <input type="submit">
    </form>"""


class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.out.write(form)



class TestHandler(webapp2.RequestHandler):
    def get(self):
        q=self.request.get("q")
        self.response.out.write(q)

apps = webapp2.WSGIApplication([('/', MainPage),('/testform',TestHandler)],debug=True)


def main():
    apps.run()


if __name__ == '__main__':
    main()
 

###############################################################################

when running this code on ubuntu 12.04 using command 

python hello_world.py

error obtained 


AssertionError: Headers already set!
Status: 500 Internal Server Error
Content-Type: text/plain
Content-Length: 59


##########################################################################

want help please urgent  ....................

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


Thread

AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 Jaiky <jaiprakashsingh213@gmail.com> - 2013-07-29 05:55 -0700
  Re: AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 Terry Reedy <tjreedy@udel.edu> - 2013-07-29 12:39 -0400

csiph-web