简体   繁体   English

当我运行 flask 应用时调试器 PIN 是什么 python

[英]What is Debugger PIN when I run the flask app python

  • Debugger is active!调试器已激活!
  • Debugger PIN: 620-122-212调试器 PIN:620-122-212

I see this when I run the flask app and i'm trying to understand where it will get used?我在运行 flask 应用程序时看到了这一点,我试图了解它将在何处使用?

Please let me know!请告诉我!

This is a security code for the debugger. 这是调试器的安全代码。 Its purpose is to make access to the debugger more difficult for an attacker in a production environment. 其目的是使生产环境中的攻击者更难以访问调试器。 More details here 更多细节在这里

This is an additional security measure provided by Werkzeug (which is one of the dependencies for Flask ) to prevent the debugger from being accessible without the knowledge of the PIN . 这是Werkzeug提供的一项额外的安全措施(它是Flask的依赖项之一),可防止在不知道PIN情况下访问调试器。 You can use the debugger pin in the browser to launch the interactive debugger. 您可以使用浏览器中的调试器引脚启动交互式调试器。

Please note you should never be using DEBUG mode in Production anyways because the stack trace of error can potentially reveal multiple aspects of your code. 请注意,您永远不应该在Production使用DEBUG模式,因为错误的堆栈跟踪可能会泄露代码的多个方面。

The Debugger PIN is a just an added layer of security in case you inadvertently leave the Debug mode on in an Production application to make it difficult for the attacker to access the debugger . Debugger PIN只是一个额外的安全层,以防您无意中在Production应用程序中启用Debug模式,以使攻击者难以访问调试器。

OP asked OP问

i'm trying to understand where it will get used?我试图了解它将在哪里使用?

and commented on the approved answer that he still wondering where to use the PIN to debug the program without adding a logger.并评论了批准的答案,他仍然想知道在哪里使用 PIN 来调试程序而不添加记录器。

To any new viewers wondering where to access the debugger and use the PIN, it is accessible in the flask application at /console对于任何想知道在哪里访问调试器和使用 PIN 的新观众,可以在/console的 flask 应用程序中访问它

A window requesting the PIN will pop up:将弹出请求 PIN 的 window: 在此处输入图像描述

You can enter your PIN there, click Confirm Pin and access the interactive console of your flask application.您可以在那里输入您的 PIN,单击Confirm Pin并访问 flask 应用程序的交互式控制台。 Please remember to turn OFF debug mode when deploying to production.请记住在部署到生产环境时关闭调试模式。

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

相关问题 使用 python 运行 flask 应用程序,而不是运行 flask - Run flask app with python instead of flask run 在调试模式下运行 Flask 应用程序不提供 IP 或调试器 PIN 或任何请求详细信息 - Running Flask app in debug mode does not provide the IP or the Debugger PIN or any Request details 如何诊断 Python Flask 应用程序中仅在应用程序与 uWSGI 一起运行时出现的问题? - How do I diagnose problems in a Python Flask application that only occur when app is run with uWSGI? Flask:使用`flask run`但能够使用`python app.py`运行应用程序时出现ModuleNotFoundError - Flask: ModuleNotFoundError when use `flask run` but able to run app using `python app.py` Flask + Docker应用-当我运行docker run时容器死亡 - Flask + Docker app - The container dies when i run docker run 当我运行 flask 应用程序时出现此错误 - When i run the flask app i get this error python如何在线程中运行flask应用程序? - python How can I run flask app in a thread? 错误:当我在Visual Studio代码中运行flask应用程序时 - Error: when I run flask app in visual studio code 烧瓶应用无法运行时,该如何调试? - How can I debug my flask app when it wont run? 当我运行我的应用程序时,Flask 抛出异常 - Flask throwing exception when i run my app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM