2
我是Python的新手,我试图用Python Anywhere运行web.py应用程序,但我一直得到No template named index
错误。我修改wsgi.py
使用如下:没有模板命名索引错误
import web
import MySQLdb
urls = (
'/', 'index'
)
render = web.template.render('/home/user/templates/')
任何帮助将不胜感激。
首先,你实际上是使用文字字符串''/ home/user/templates /' ',或''/ home/rhpt/templates /''(或任何你的用户名)?其次,你是否真的创建了该目录并在其中放置了任何东西?如果没有,当然你会遇到某种错误试图访问它。你在学习某种教程吗?如果是这样,你跟随哪一个,并且你在任何时候都偏离它? – abarnert
我解决了这个问题。我应该读更好的方向。它应该是/ home// –
RHPT
这是我第一次猜测你的问题。我会写它作为答案。 – abarnert