.. _tg1_app_example: TurboGears 1 ============ This tutorial assumes basic familiarity with TurboGears 1. Beginners should read the TurboGears `Wiki20 tutorial`_. The tutorial was developed using TurboGears 1.0.8. .. _Wiki20 tutorial: http://docs.turbogears.org/1.0/Wiki20/Page1 First, quickstart an app using the standard approach. It doesn't really matter what options you use, although this tutorial assumes the defaults:: $ tg-admin quickstart myapp Enter package name [myapp]: Do you need Identity (usernames/passwords) in this project? [no] To enable ToscaWidgets, edit ``myapp/config/app.cfg`` and add the following line:: toscawidgets.on = True To create a sample widget, edit ``myapp/controllers.py`` and add:: from tw.forms.samples import AddUserForm test_form = AddUserForm('mytest') In the same file, we'll also add a new controller method ``movie``, which passes the widget into the template. Add the following to the ``Root`` class:: @expose('myapp.templates.movie') def movie(self): return dict(test_form=test_form) We now need to create this template. Create ``myapp/templates/movie.kid`` as follows::