Latest posts on Pylons + Cheetah topichttps://python.su/forum/topic/911/2007-06-30T15:09:05+03:00Веб-технологии :: Pyramid / Pylons / TurboGears :: Pylons + Cheetah
2007-06-30T15:09:05+03:00alafin6298Самое интересное, что когда я пытаюсь подобным образом прикрутить mako templates то все работает как часы. Но вот беда с cheetah все же остается. Возможно все таки я что-то забыл установить для корректной работы cheetah.
Веб-технологии :: Pyramid / Pylons / TurboGears :: Pylons + Cheetah
2007-06-20T23:21:00+03:00alafin5983Хочу прикрутить к Pylons Cheetah. Все что нужно было все установил. Подскажите что я делаю не так.<br/>1. Создаю проект myapp:<br/>paster create –template=pylons myapp<br/>2. Вношу изменения в файл myapp/config/middleware.py(кусок из файла):<br/><br/> # Load our Pylons configuration defaults<br/> config = load_environment(conf)<br/> config.init_app(global_conf, app_conf, package='myapp', template_engine='pylonsmyghty')<br/> config.add_template_engine(“cheetah”, “myapp.templates”, {})<br/><br/>3. Создаю контроллер mycontrol:<br/>paster controller mycontrol<br/>4. Вношу изменения в контроллер mycontrol:<br/><br/>from myapp.lib.base import *<br/><br/>class MycontrolController(BaseController):<br/> def index(self):<br/> c.what = “Cheetah world”<br/> return render_response(“cheetah”, “index”)<br/><br/>5. Создаю шаблон myapp/templates/index.tmpl:<br/>Hello, ${what}!<br/>6. Добавляю в myapp/config/routing.py:<br/>map.connect(':controller/:action/:id', controller='mycontrol', action='index', id=0)<br/><br/>В итоге при запуске <a href="http://localhost:5000/mycontrol/">http://localhost:5000/mycontrol/</a> ругается на:<br/>Module myapp.controllers.mycontrol:6 in index <br/><br/>self <myapp.controllers.mycontrol.MycontrolController object at 0xb093d6ec> <br/><br/><< def index(self):<br/> c.what = “Cheetah world”<br/> return render_response(“cheetah”, “index”)>> return render_response(“cheetah”, “index”)<br/><br/>Где я мог допустить прокол?