最近,我一直在尝试学习WebPy,在尝试使用教程(http://webpy.org/docs/0.3/tutorial)中的模板时,我在尝试访问页面时遇到了这个错误。
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/application.py", line 239, in process
return self.handle()
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/application.py", line 230, in handle
return self._delegate(fn, self.fvars, args)
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/application.py", line 420, in _delegate
return handle_class(cls)
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/application.py", line 396, in handle_class
return tocall(*args)
File "/Users/clement/Desktop/#Minecraft/index2.py", line 14, in GET
return render.index(name)
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/template.py", line 1017, in __getattr__
t = self._template(name)
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/template.py", line 1014, in _template
return self._load_template(name)
File "/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg/web/template.py", line 1001, in _load_template
raise AttributeError, "No template named " + name
AttributeError: No template named index我在SOF上看过这个Question,但我无法让它在我的情况下工作。我花了大约4个小时试图弄清楚这一点,并试图按照我启动服务的方式重新工作,通常是通过以下方式完成的:
Macintosh-2:~ clement$ python /Users/clement/Desktop/\#Minecraft/index.py谢谢!
发布于 2012-10-22 17:07:19
我相信我找到了答案。
解决:
希望这能帮助有类似问题的人:)
(注:运行OS X 10.8.1)
https://stackoverflow.com/questions/13016003
复制相似问题