Turbogears2 tutorial to  create an MVC AppThis SlideShow is the continuation of the     documentation available here.
What is the app about?Its a simple note taking application, that wouldprovide users the functionality to:● create a new no...
Create a virtual environment●   $ easy_install virtualenv●   $ virtualenv tg2envi●   $ cd tg2envi●   $ source bin/activate...
Create the app● (tg2envi)$ paster quickstart TgDemo● Enter package name [tgdemo]: tg2notes  ○ Would you prefer mako templa...
Project Directory Overview        .        |-- config        |-- controllers        |-- i18n        | `-- ru        |     ...
Model DesignThe database fields that needs to be presentare:● author● note title● note description● subject● dateCreate a ...
Widget DesignWe need to design the UI for the forms that willbe rendered in the templates.Create a folder called widgets p...
Controllers DesignStuff we need to take care:● The file root.py in folder controllers is the  right place to do things.● I...
DoneWe are done, we just usedCrudRestController,feature from turbogears to design the aboveapplication.You might:1. write ...
Upcoming SlideShare
Loading in …5
×

Turbogears2 tutorial to create mvc app

2,571 views

Published on

This presentation is a simple tutorial about developing a note taking application using TurboGears2 python framework.

The tutorial is intended to get you familiarized with the updated turbogears2 python framework.

Additional documentation/explanation can be found at http://blog.fruiapps.com/2012/05/TurboGears2-tutorial-to-create-a-simple-MVC-application

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,571
On SlideShare
0
From Embeds
0
Number of Embeds
1,082
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Turbogears2 tutorial to create mvc app

  1. 1. Turbogears2 tutorial to create an MVC AppThis SlideShow is the continuation of the documentation available here.
  2. 2. What is the app about?Its a simple note taking application, that wouldprovide users the functionality to:● create a new note● delete a note● edit a noteLets get started!!
  3. 3. Create a virtual environment● $ easy_install virtualenv● $ virtualenv tg2envi● $ cd tg2envi● $ source bin/activate● (tg2envi) pip install -r requirements.txt
  4. 4. Create the app● (tg2envi)$ paster quickstart TgDemo● Enter package name [tgdemo]: tg2notes ○ Would you prefer mako templates? (yes/[no]): no ○ Do you need authentication and authorization in this project? ([yes]/no): no ......● (tg2envi)$ cd TgDemo● (tg2envi)$ python setup.py develop● (tg2envi)$ paster setup-app development.ini● (tg2envi)$ paster serve development.ini
  5. 5. Project Directory Overview . |-- config |-- controllers |-- i18n | `-- ru | `-- LC_MESSAGES |-- lib |-- model |-- public | |-- css | |-- images | `-- javascript |-- templates |-- tests | |-- functional | `-- models `-- websetup
  6. 6. Model DesignThe database fields that needs to be presentare:● author● note title● note description● subject● dateCreate a file called note.py in the modeldirectory. (content here)
  7. 7. Widget DesignWe need to design the UI for the forms that willbe rendered in the templates.Create a folder called widgets parallel tocontrollers, add a file called forms.py.We need to design the create form and editform, which will be rendered in the templates totake/edit the notes. (content here)
  8. 8. Controllers DesignStuff we need to take care:● The file root.py in folder controllers is the right place to do things.● Import the necessary libraries.● Include the forms we designed.● Mention the database and session● Put the following content.
  9. 9. DoneWe are done, we just usedCrudRestController,feature from turbogears to design the aboveapplication.You might:1. write to us your doubts/suggestions /queries to contact@fruiapps.com.2. share the presentation.3. follow us on twitter @fruiapps

×