DEV Community

qiudaozhang
qiudaozhang

Posted on

3 2

masonite关于debugger

安装

pip install masonite-debugbar
Enter fullscreen mode Exit fullscreen mode

使用

config/providers.py 文件修改

from debugbar.providers import DebugProvider
PROVIDERS = [
    ....
    DebugProvider
]

Enter fullscreen mode Exit fullscreen mode

不过上线的时候也这样就不好了,会暴露敏感信息,所以改造一下

from debugbar.providers import DebugProvider

# 如果不是生产环境,不要开启debug,即便安装了插件,也不会暴露敏感信息
if (env("APP_ENV") != 'prod'):
    PROVIDERS.append(DebugProvider)
Enter fullscreen mode Exit fullscreen mode

这样即便打开了这个工具,也看不到信息

效果1

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay