从Django向Google Stackdriver报告异常错误报告
dj-cloud-error的Python项目详细描述
dj云错误:Django Google云错误报告
向Google云Stackdriver错误报告任何Django站点的异常
- 免费软件:麻省理工学院许可证
特点
- 向Google云Stackdriver错误报告任何Django站点的异常
- 对django ipware的可选依赖关系,用于记录IP地址
快速启动
- 将应用程序配置为用户Google云项目:
- Enabled the Error Reporting api as per https://cloud.google.com/error-reporting/docs/setup/python
- Set up the required Google IAM credentials - eg set the environment variable GOOGLE_APPLICATION_CREDENTIALS as the path to a service account JSON file, for an account that has the “Errors Writer” permission.
安装软件包:
pip install dj_cloud_error
在通过在Django项目的根urls.py中设置handler500,启用提供的异常处理程序:
^{pr2}$ 在
注意:handler500仅在django设置中的DEBUG = False时使用。在
设置
要禁用错误报告(例如在CI/CD环境中),请将以下内容添加到django设置中:
# in myproject/settings/test.py CLOUD_ERROR_REPORTING_DISABLED = True
要配置中显示错误的名称,请将此添加到django设置中:
CLOUD_ERROR_REPORTING_SERVICE_NAME = "myservice" # defaults to "python"
可选附加功能
如果安装了用于记录客户机IP地址的django ipware,可以按如下方式安装:
pip install dj_cloud_error[ip]
学分
此包是用Cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的。在
历史
- PyPI的第一个版本。在
- 项目
标签: