第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

post方法返回都是none

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

import web

? ? ? ??

urls = (

'/index','index',

'/blog/\d','blog',

? ? '/(.*)', 'hello'

)

app = web.application(urls, globals())


class index:

def GET(self):

query=web.input()

return query

class blog:

def POST(self):

data=web.input()

return data


class hello:? ? ? ??

? ? def GET(self, name):

? ? ? ? return open(r'new2.html').read()


if __name__ == "__main__":

? ? app.run()

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

<!DOCTYPE HTML>

<html><head meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>小型demo</title>

</head>

<body>

<h1>POST</h1>

<form action="/blog/123" method="POST">

<input type="text" name="id" value=""/>

<input type="password" name="password" value=""/>

<input type="submit" value="submit"/>

</form>

</body>

</html>

??

上面分別是html和python的源碼,網(wǎng)頁返回的都是none

正在回答

1 回答

那你在地址欄輸入的什么呢?

如果你輸入的是可以匹配上這個(gè)的'/blog/\d','blog',那么頁面可能會(huì)返回none;

如果想找到那個(gè)表單界面,只需要匹配?'/(.*)', 'hello',然后輸入用戶名密碼,提交后地址欄就會(huì)變成http://127.0.0.1:8080/blog/123,但是由于你上面寫的是\d,但是\d只能匹配上一個(gè)數(shù)字。。你可以試試改成\d+,或者吧html頁面的<form action="/blog/123" method="POST">改成<form action="/blog/1" method="POST">

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
python-web.py開發(fā)入門
  • 參與學(xué)習(xí)       58634    人
  • 解答問題       118    個(gè)

web.py開發(fā)入門入門教程,講解一個(gè)你最快能學(xué)會(huì)的web開發(fā)的框架

進(jìn)入課程

post方法返回都是none

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)