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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

找不到燒瓶 404

找不到燒瓶 404

冉冉說 2021-09-14 16:46:55
我正在嘗試運(yùn)行我的代碼,但是當(dāng)我點(diǎn)擊鏈接時(shí),我得到了404: Not Found. 這是我的代碼:from flask import Flask,jsonify,render_template,requestapp = Flask(__name__)if __name__ == '__main__':    app.run()tempusage = 0weightsusage = 0curencyusage = 0cost = 0userip = '1.1.1.1'@app.route('/tempreature/c2f/<int:temp>', methods=['GET'])def c2f(temp):    tempreature = temp    ftemp = (tempreature * (9/5)) + 32    tempreatures = [    {        'conversionType': u'Tempreature',        'from': u'Celcius',        'fromValue':tempreature,        'to' : u'Faherenheit',        'tovalue':ftemp    }]    global userip    userip = request.environ['REMOTE_ADDR']    global tempusage    if userip == request.environ['REMOTE_ADDR']:       tempusage  += 1    return jsonify({'tempreatures':  tempreatures})@app.route('/tempreature/f2c/<int:temp>', methods=['GET'])def f2c(temp):    tempreature = (temp -32)*(5/9)    ftemp = tempreature/10    tempreatures = [    {        'conversionType': u'Tempreature',        'from': u'Faherenheit',        'fromValue':tempreature,        'to' : u'Celcius',        'tovalue':ftemp    }]    global tempusage    global userip    userip = request.environ['REMOTE_ADDR']    if userip == request.environ['REMOTE_ADDR']:       tempusage += 1    return jsonify({'tempreatures':  tempreatures})@app.route('/weight/k2p/<int:w>', methods=['GET'])def k2p(w):    weight = w*2.205    fweight= w/10    weights = [    {        'conversionType': u'Weight',        'from': u'kg',        'fromValue':weight,        'to' : u'pounds',        'tovalue':fweight    }]    global userip    userip = request.environ['REMOTE_ADDR']    global weightsusage    if userip == request.environ['REMOTE_ADDR']:      weightsusage += 1    return jsonify({'weights': weights})我在終端得到這個(gè):* 服務(wù) Flask 應(yīng)用程序“app”(延遲加載) * 環(huán)境:生產(chǎn)   警告:不要在生產(chǎn)環(huán)境中使用開發(fā)服務(wù)器。   改用生產(chǎn) WSGI 服務(wù)器。 * 調(diào)試模式:關(guān)閉 * 在 http://127.0.0.1:5000/ 上運(yùn)行(按 CTRL+C 退出)127.0.0.1 - - [11/Dec/2018 16:15:42] "GET / HTTP/1.1" 404 -
查看完整描述

2 回答

?
米脂

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超3個(gè)贊

一個(gè)簡(jiǎn)單的,但即使在編程五十年后我也會(huì)犯這樣的錯(cuò)誤。您可能會(huì)發(fā)現(xiàn)您的 Python 運(yùn)行良好,但是您沒有為您嘗試訪問的 URL 提供路由!你應(yīng)該裝飾一些功能

@app.route('/')

在該功能中,您可以呈現(xiàn)主頁。


查看完整回答
反對(duì) 回復(fù) 2021-09-14
?
侃侃無極

TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個(gè)贊

嘗試@app.route('/')為您的功能之一添加,而路線中沒有任何其他內(nèi)容。


查看完整回答
反對(duì) 回復(fù) 2021-09-14
  • 2 回答
  • 0 關(guān)注
  • 172 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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