Plugins 插件清单

fansichao 2021-10-23 16:25:17
Categories: Tags:

环境说明

插件详细清单

主要内容项

优质插件

django-debug-toolbar debug调试工具

https://django-debug-toolbar.readthedocs.io/en/latest/

sentry - 哨兵机制

功能:

  1. 监控服务是否正常, 提供错误报警错误日志等等
  2. 支持多平台多语种监控, 支持统一管理配置
  3. 强力推荐, 适合项目管理管控 ★★★★★

步骤1: 安装服务

1
pip install --upgrade sentry-sdk

步骤2: 配置项目

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration

sentry_sdk.init(
# DSN 需要从 sentry 管理界面中获取....
dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
integrations=[DjangoIntegration()],

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production,
traces_sample_rate=1.0,

# If you wish to associate users to errors (assuming you are using
# django.contrib.auth) you may enable sending PII data.
send_default_pii=True,

# By default the SDK will try to use the SENTRY_RELEASE
# environment variable, or infer a git commit
# SHA as release, however you may want to set
# something more human-readable.
# release="myapp@1.0.0",
)

步骤3: 试用(设置错误用例 并查看消息)

1
2
3
4
5
6
7
8
9
10
11
from django.urls import path


def trigger_error(request):
division_by_zero = 1 / 0


urlpatterns = [
path('sentry-debug/', trigger_error),
# ...
]

sentry-django.png

参考资源

优质项目

wagtail

https://github.com/wagtail/wagtail
内容管理发布系统

参考资源

插件清单