[英]What is Debugger PIN when I run the flask app python
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.