代码之家  ›  专栏  ›  技术社区  ›  noobie-php

在服务器上找不到请求的URL。如果您手动输入了URL,请检查拼写并重试。瓶

  •  0
  • noobie-php  · 技术社区  · 3 年前

    所以我试着用烧瓶 flask_classful ,我遵循上面描述的基本应用程序 http://flask-classful.teracy.org/ ,我得到以下错误

    未找到 在服务器上找不到请求的URL。如果您输入了URL 请手动检查拼写,然后重试。

    这是我在handler.py中使用的基本代码

    from flask import Flask
    from flask_classful import FlaskView
    
    # we'll make a list to hold some quotes for our app
    quotes = [
        "A noble spirit embiggens the smallest man! ~ Jebediah Springfield",
        "If there is a way to do it better... find it. ~ Thomas Edison",
        "No one knows what he can do till he tries. ~ Publilius Syrus"
    ]
    
    app = Flask(__name__)
    
    class QuotesView(FlaskView):
        def index(self):
            return "<br>".join(quotes)
    
    QuotesView.register(app)
    
    if __name__ == '__main__':
        app.run()
    
    0 回复  |  直到 3 年前