I posted in this list earlier asking about a browser download prompt.
Someone recommended I try adding a header to the response, so I tried
this:
--------
import web
web.webapi.header("Content-Type","text/html; charset=utf-8")


urls = (
    '/.*', 'hello',
    )

class hello:
    def GET(self):
        return "Hello, world."

application = web.application(urls, globals()).wsgifunc()
------

And when I ran it in my browser, I got an Internal Server Error. This
was in my error.log:

[Sun Jun 21 16:15:55 2009] [error] [client ::1] mod_wsgi (pid=8620):
Target WSGI script '/var/www/test.py' cannot be loaded as Python
module.
[Sun Jun 21 16:15:55 2009] [error] [client ::1] mod_wsgi (pid=8620):
Exception occurred processing WSGI script '/var/www/test.py'.
[Sun Jun 21 16:15:55 2009] [error] [client ::1] Traceback (most recent
call last):
[Sun Jun 21 16:15:55 2009] [error] [client ::1]   File "/var/www/
test.py", line 2, in <module>
[Sun Jun 21 16:15:55 2009] [error] [client ::1]     web.webapi.header
("Content-Type","text/html; charset=utf-8")
[Sun Jun 21 16:15:55 2009] [error] [client ::1]   File "/var/lib/
python-support/python2.6/web/webapi.py", line 179, in header
[Sun Jun 21 16:15:55 2009] [error] [client ::1]     ctx.headers.append
((hdr, value))
[Sun Jun 21 16:15:55 2009] [error] [client ::1]   File "/var/lib/
python-support/python2.6/web/utils.py", line 830, in __getattr__
[Sun Jun 21 16:15:55 2009] [error] [client ::1]     return getattr
(self._getd(), key)
[Sun Jun 21 16:15:55 2009] [error] [client ::1]   File "/var/lib/
python-support/python2.6/web/utils.py", line 64, in __getattr__
[Sun Jun 21 16:15:55 2009] [error] [client ::1]     raise
AttributeError, k
[Sun Jun 21 16:15:55 2009] [error] [client ::1] AttributeError:
'headers'

Can someone help me fix this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to