最近、私は 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 に関するこの質問を見てきましたが、私の状況では機能しませんでした。私はこれを理解しようとして約4時間を費やし、通常は次の方法でサービスを起動する方法を作り直そうとしました:
Macintosh-2:~ clement$ python /Users/clement/Desktop/\#Minecraft/index.py
ありがとう!