【发布时间】:2014-05-22 18:54:07
【问题描述】:
我升级到 Python 1.4.5,当我尝试运行我的项目时出现以下错误:
ValueError: No such renderer factory .mak
[Applications/MAMP/htdocs/WhoAt/env/www/www/views/index/index.py line:32]
get()
->return self.render(mak)
[Applications/MAMP/htdocs/WhoAt/env/www/www/views/__init__.py line:231]
render()
->response = render_to_response(template, context, request=self.request)
[Applications/MAMP/htdocs/WhoAt/env/lib/python2.7/site-packages/pyramid/renderers.py line:138]
render_to_response()
->return helper.render_to_response(value, None, request=request)
ValueError: No such renderer factory .mak
我昨天查了一下,得知默认情况下不再支持 mako 模板。他们必须重新添加:What's New In Pyramid 1.5
我按照该文档页面上的步骤操作,但仍然收到错误:(
在init.py
中config.include('pyramid_mako') # < added that
config.add_static_view('static', 'static', cache_max_age=3600)
config.scan()
return config.make_wsgi_app()
并且在 setup.py 中添加了 'pyramid_mako' 和 chameleon
requires = [
'pyramid',
'pyramid_mako',
'pyramid_chameleon',
'pyramid_debugtoolbar',
'waitress',
]
还在终端运行 setup.py :(
还有其他人在 PyCharm 中修复 mako 模板时遇到过问题吗?
我的点子冻结的打印列表:http://codepen.io/leongaban/pen/Bvakw/
【问题讨论】:
-
看起来我可能在这里找到了答案 :( 现在重新创建我的 virtualenv stackoverflow.com/questions/10888577/…
标签: python pyramid pylons mako