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

Newsgroups comp.lang.python
Date 2013-07-29 05:55 -0700
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>

Show all headers | 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