0
我打算制作文件管理器系统,但它是奇怪的问题,当我应用返回目录内容的函数会引发错误!没有找到瓶子模板(错误500)
这里是我的函数返回目录中的内容从文件管理系统
@route("/TofePanel/FileManager/<filepath:path>")
def FileMamager(filepath):
if request.get_cookie("__auth",secret="xxxxxxxx") is "xxxxxxxx":
cont=GET_Contents(filepath)#just calling the function and ignore result
return template("static/templates/TCP/FileMgr",PATH=filepath)
else:
redirect("/TofePanel/Login")
它抛出一个错误,指出(在我的机器上工作的100%)
def GET_Contents(filepath):
os.chdir("files")
os.chdir(filepath)
contents=os.listdir(os.getcwd())
return contents
这里代码:Template 'static/templates/TCP/FileMgr' not found.
但是当我评论cont=GET_Contents(filepath)#just calling the function and ignore result
它工作正常!
先生......你真棒的xD – Hamoudaq