I discovered web2py last night. This is unlike any web framework you’ve ever seen and its open source and 100% free. With web2py the batteries are included and there is zero to install additionally or configure. Its all self-contained, in fact you don’t even need a code editor to work with the scripts since one is provided and hosted in the web browser. The language used is Python and you’ll find a Python interpreter is already included as well. Simply download, extract, and then run the executable and your up and running and ready to create your first web app.
I did a “Hello World” tutorial in less than two minutes. Once I had web2py downloaded and extracted (I’m using Windows XP on a Virtual Machine) I went ahead and ran the “web2py.exe” file and was greeted with the following window:
I entered “password” as my admin password. Once the server fires up it opens in your default browser to the following introduction page:
Clicking on the admin link it takes you to a page that shows what all web apps are installed as well as a way to upload news ones or to create one. In this case I created one called “HelloWorld”.
From here if you enter the address: http://127.0.0.1:8000/HelloWorld you would see this page which is the default page generated with new projects:
If you look at the code for the default.py controller you see it lays out the code in a nice format right within your browser.
Even though web2py already generated the “Hello World” for me – and with a fancier effect I’m still going to modify the code just to show how nice the code editor is they packaged with web2py. So go ahead and edit the “default.py” code.
Change the default code for the “index” method to the following (yes, we are making it pretty ugly and boring by doing this):
Now go ahead and refresh the tab/page where the “HelloWorld” project is running and you should see this.
(Keep in mind you can edit the index.html view to make it look nicer if you wanted to)