Image

Imagenull_ua wrote in Imageru_python

Pylons+Cheetah

Хочу прикрутить к Pylons Cheetah. Все что нужно было все установил. Подскажите что я делаю не так.
1. Создаю проект myapp:
paster create --template=pylons myapp
2. Вношу изменения в файл myapp/config/middleware.py(кусок из файла):

# Load our Pylons configuration defaults
config = load_environment(conf)
config.init_app(global_conf, app_conf, package='myapp', template_engine='pylonsmyghty')
config.add_template_engine("cheetah", "myapp.templates", {})

3. Создаю контроллер mycontrol:
paster controller mycontrol
4. Вношу изменения в контроллер mycontrol:

from myapp.lib.base import *

class MycontrolController(BaseController):
def index(self):
c.what = "Cheetah world"
return render_response("cheetah", "index")

5. Создаю шаблон myapp/templates/index.tmpl:
Hello, ${what}!
6. Добавляю в myapp/config/routing.py:
map.connect(':controller/:action/:id', controller='mycontrol', action='index', id=0)

В итоге при запуске http://localhost:5000/mycontrol/ ругается на:
Module myapp.controllers.mycontrol:6 in index

<< def index(self):
c.what = "Cheetah world"
return render_response("cheetah", "index")>> return render_response("cheetah", "index")

Где я мог допустить прокол?