【问题标题】:Debug link missing in PyCharm after changing from Python 2 to Python 3从 Python 2 更改为 Python 3 后 PyCharm 中缺少调试链接
【发布时间】:2016-03-16 04:39:15
【问题描述】:

我不确定这是否是某个地方的设置,但是在将我的项目从 Python 2.7 更改为 Python 3.5 后,我在“运行”窗口中丢失了调试链接。

这是运行 Python 2.7 的屏幕截图:

这是运行 Python 3.5 的屏幕截图:

我是缺少插件还是在某个地方为此设置了设置?我不想每次调试新项目时都在寻找链接。

我正在运行 PyCharm 4.5.3 版

更新

app.debug = True 时会隐藏链接,但设置为False 时会显示链接(仅适用于 Python 3)

这是我的点子列表:

Flask (0.10.1)
Flask-Login (0.3.2)
Flask-SQLAlchemy (2.1)
itsdangerous (0.24)
Jinja2 (2.8)
MarkupSafe (0.23)
pip (7.1.2)
PyMySQL (0.6.7)
setuptools (18.2)
SQLAlchemy (1.0.9)
Werkzeug (0.11.2)
WTForms (2.0.2)
XlsxWriter (0.7.7)

【问题讨论】:

    标签: python-2.7 pycharm python-3.5


    【解决方案1】:

    问题来自Werkzeug 的版本。在Werkzeug 0.11.02中,如果app.debug设置为True,项目链接将不会显示

    取自WerkZeug,您直接调用run_simple,同时传入hostportapp,作为一种解决方法。

    from flask import Flask
    app = Flask('my_app')
    app.debug = True
    
    if __name__ == '__main__':
        from werkzeug.serving import run_simple
        run_simple('localhost', 4000, app)
    

    【讨论】:

    • 做到了。谢谢。
    猜你喜欢
    • 2020-04-02
    • 2018-08-31
    • 2016-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-20
    • 1970-01-01
    • 2016-10-19
    相关资源
    最近更新 更多