Sunday, January 10, 2016

Getting started with web2py framework

    Full Stack web development with Python (Web2Py)
    How to download and install web2py
1.  Go  to
2.   Down load latest version
     Unzip the downloaded file
     CliCk on the Web2py.exe file to it will open the window like below

           Provide the password(any password) and start the server
           Server has been started. Now we need to create a application using web2py framework.


         Click on the Admin,  which is there on the right side in the page. And provide the password which      we have given while starting the server

                After Successful Login,  page will be open like below.

               Create a new application using this framework- > New simple application –
       Application Name - ex: sivaweb2py
              Click on the create button. Now we have created application successfully.
               Need to run the application

              Now we need to write sample code in this application. So we need to understand basics of  the
               Need to edit the application

      This framework will follow MVC architecture
          Model- Contains db details
         Controller – Method and logic details
         Views – Html input/output to the user

Now we need to create one controller and respective views
Click on the Create button under Controller Section
I have given controller name as basics – will be created under controller

       Now edit the controller – Click on the
     def helloworld():
     msg= "Hello welcome to basics controller!"
     return locals()

 In the above code helloworld is method name . Copy the code and paste the same in your file.
  Save the file and go to back – by click on the back buton
  Now we need to create a  view- under Views section
  View name should be as method name  ex: basics/helloworld

   {{extend 'layout.html'}}
    This is our first web page
   {{ =msg}}

Writing first web2py is very easy





Contact Form


Email *

Message *