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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么這個燒瓶沒有根據(jù)我的代碼顯示標準消息?

為什么這個燒瓶沒有根據(jù)我的代碼顯示標準消息?

慕勒3428872 2023-03-16 17:02:20
我的休息服務位于http://127.0.0.1:5000,但是當我啟動它時,它給了我 404:Not FoundThe requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.這是為什么?我希望我的服務器顯示一些狀態(tài)消息,例如“服務就緒”。當我按“http://127.0.0.1:5000/parser/tengrinews”并按回車鍵時,我將使用的實際功能是可訪問且有效的,它會輸出我在 Flask 應用程序的功能中編碼的消息:[  "parsing this website :",   "tengrinews"]主要代碼:from flask import Flaskimport requestsfrom datetime import datetimefrom flask import jsonifyapp = Flask(__name__)#this is my std method i can't see@app.route("/http://127.0.0.1:5000/", methods = ['GET'])def main():    return jsonify('service is ready')@app.route("/parser/<string:website>", methods = ['GET'])def parse(website):        return jsonify("parsing this website :", website   )if __name__ == "__main__":    app.run(debug=True)
查看完整描述

1 回答

?
天涯盡頭無女友

TA貢獻1831條經(jīng)驗 獲得超9個贊

更改此行 -

@app.route("/http://127.0.0.1:5000/", methods = ['GET'])

@app.route("/", methods = ['GET'])

因為您只需指定將要使用的擴展 URL。裝飾@app.route者為我們處理剩下的事情

注意*(不要這樣做。僅供娛樂)-
如果您想繼續(xù)使用,@app.route("/http://127.0.0.1:5000/", methods = ['GET'])請使用 url - 訪問端點http://localhost:5000/http://127.0.0.1:5000/。你會得到這樣的回應"service is ready"


查看完整回答
反對 回復 2023-03-16
  • 1 回答
  • 0 關注
  • 110 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號