web.py form表单填写内容,通过post方法提交,为什么老提示" POST /add" - 405 Method Not Allowed

html代码:
$def with (user)
<ul>
$for User in user:
<li>$User.user_name,$User.user_id,$User.account,$User.password</li>
</ul>
<form method="post" action="add">
<input type="text" name="user_name"/>
<input type="text" name="account"/>
<input type="text" name="password"/>
<input type="submit" vlaue="提交"/>
</form>

python代码:
#-*- coding: utf-8 -*-
import web
import sqlite3
from web import form as form
render=web.template.render('templates/')
urls = (
'/', 'index',
'/add','add'
)
db = web.database(dbn='sqlite', db='BMS.db')
app = web.application(urls, globals())
class index:
def GET(self):
user=db.select("User")
print user
return render.index(user)
#return len(list(user1))
class add:
def Post(self):
i=web.input()
name,account,password=i.name,i.account,i.password
n=db.insert('Book',book_name='name',account='account',password='password')
raise web.seeother("/")

if __name__ == "__main__":
app.run()

POST 方法名字写错了:
将 def Post(self) 改为 def POST(self)追问

已经改过来了,谢谢了

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网