from turbogears import controllers, expose, flash
# from foto import model
import logging
log = logging.getLogger("foto.controllers")
class Root(controllers.RootController):
@expose(template="foto.templates.welcome")
def index(self):
import time
# log.debug("Happy TurboGears Controller Responding For Duty")
flash("Your application is now running")
return dict(now=time.ctime())
@expose(template="foto.templates.pokus")
def pokus(self):
import time
log.debug("*** Nekdo navstivil fologalerii ***")
flash("Fotografie")
return dict(current_time=time.ctime())
==== Soubor template/pokus.kid ====
Fotografie
tento text bude nahrazen hodnou promenne current_time
==== Spuštění aplikace ====
./start-foto.py
http://localhost:8080