FireCat
V2EX  ›  问与答

Flask 的 debug 模式不能开启。

  •  
  •   FireCat · Dec 6, 2015 · 4519 views
    This topic created in 3821 days ago, the information mentioned may be changed or developed.

    uwsgi 运行的 flask 。
    debug 已经开了可是并没起作用。
    ```
    from flask import Flask
    app = Flask(name)

    app.debug = True
    app.host = '127.0.0.1'
    app.port = 8000
    @app.route("/")
    def hello():
    return "Hadsda!"

    @app.route("/u/<username>")

    def showusername(username):
    return "User %s!" % username;
    '''
    @app.route("/<int:post_id>")
    return "Post %s" % post_id;
    '''
    if __name
    _ == "main":
    #app.run(host='127.0.0.1', port=8080)
    app.run()
    ```

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2999 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 08:55 · PVG 16:55 · LAX 01:55 · JFK 04:55
    ♥ Do have faith in what you're doing.