Overview of features
Home
Read this first
About
web2py is 100% free
Download
Start learning web2py today
Documentation
Authors and contributors
Staff
Affiliated companies
Support
Edit page
Title:
Security Code:
Body:
(use
this
wiki markup)
We really like web.py but web2py has nothing to do with it. Really. The name is similar by accident. They are very very different beasts although you can translate web.py code into web2py code. This is an example of web.py code (not us) import web urls = ( '/(.*)', 'hello' ) class hello: def GET(self, name): i = web.input(times=1) if not name: name = 'world' for c in range(int(i.times)): print 'Hello,', name+'!' if __name__ == "__main__": web.run(urls, globals()) which we could translate in web2py as ### in routes.py (optional) routes_in=(('/.*','/myapp/default/hello'),) ### in controller default.py def hello(): return dict(times=request.vars.times or 1,name=request.vars.name or 'world') ### in view default/hello.py {{extend 'layout.html'}} {{for i in range(int(times)):}}Hello, {{=name}}!{{pass}} Although we would never write code like this where input is not validated! web2py has objects/helpers to build secure validated forms.