manage.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:rest_api 作者: opentargets 项目源码 文件源码
def runserver(host="127.0.0.1", port=8080):
    """Run a gevent-based WSGI server."""
    port = int(port)

    wrapped_app = app
    if app.config.get("DEBUG", True):
        #it is necessary to do this for the debug to work, since the classic
        # flask debugger does not operate when running the app from
        # a WSGIServer() call.
        wrapped_app = DebuggedApplication(app)

    server = WSGIServer(listener=(host, port), application=wrapped_app,)

    def serve():
        print(" * Running on http://%s:%d/" % (host, port))
        server.serve_forever()

    if app.debug:
        # the watchdog reloader (with watchdog==0.8.3) appears to hang on
        # Windows 8.1, so we're using stat instead
        run_with_reloader(
            serve, reloader_type="stat" if sys.platform == "win32" else "auto")
    else:
        serve()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号