简体   繁体   English

女服务员开始时未找到页面

[英]Not Found page when waitress start

I get this error when I access the default page after starting the flask server using the waitress.使用女服务员启动 flask 服务器后访问默认页面时出现此错误。

The code is:代码是:

from app import app
from waitress import serves

if __name__ == '__main__':
     serves (app, host = "0.0.0.0", port = 8080)

I access the page http://localhost:8080 in the browser我在浏览器中访问页面http://localhost:8080

erro: Not Found The requested URL was not found on the server.错误:未找到服务器上未找到请求的 URL。 If you entered the URL manually please check your spelling and try again.如果您手动输入了 URL,请检查您的拼写并重试。

You need a url handler:您需要一个 url 处理程序:

@app.route('/') 
def index():
    return "hello"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM