I'm working through a webpy tutorial [1] and I've run into a problem.
All the code samples in the tutorial work fine for me but when I add
the next two pieces of code my browser gives me an internal server
error:
--------------------
class hello:
def GET(self):
return render.hello("Templates demo", "Hello", "A long time ago...")
class bye:
def GET(self):
return render.bye("Templates demo", "Bye", "14", "8", "25", "42", "19")
--------------------
Here's the code of my hello.py file:
--------------------
import web
urls = (
'/', 'hello',
'/bye/', 'bye')
application = web.application(urls, globals()).wsgifunc()
render = web.template.render('templates/')
class hello:
def GET(self):
return render.hello("Templates demo", "Hello", "A long time ago...")
class bye:
def GET(self):
return render.bye("Templates demo", "Bye", "14", "8", "25", "42", "19")
if __name__ == "__main__":
app.run()
--------------------
I'm using WSGI on windows.
Any help would be appreciated.
I guess you should be calling application.run(). Thats what you've
defined on the top.
Anand
Try this:
app = web.application(urls, globals())
application = app.wsgifunc()
if __name__ == "__main__":
app.run()
web.py application object has run method. You are trying to call run
on wsgi function.
Anand
It seems to be working for me. What is the error that you are getting.
Anand
I'm using Firefox and it just comes up with "internal server error". There's no other error info. Do you think it's a problem with WSGI, or the way I've got Apache configured?
--To view this discussion on the web visit https://groups.google.com/d/msg/webpy/-/VxqbYnJRCLMJ.
You received this message because you are subscribed to the Google Groups "web.py" group.
To post to this group, send email to we...@googlegroups.com.
To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webpy?hl=en.