Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ninjaclasher/django-discord-integration
Discord integration for Django, supporting error reporting via webhooks.
https://github.com/ninjaclasher/django-discord-integration
discord django error-reporting
Last synced: 19 days ago
JSON representation
Discord integration for Django, supporting error reporting via webhooks.
- Host: GitHub
- URL: https://github.com/ninjaclasher/django-discord-integration
- Owner: Ninjaclasher
- License: agpl-3.0
- Created: 2019-05-12T19:51:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T17:29:33.000Z (6 months ago)
- Last Synced: 2024-10-13T08:25:54.450Z (about 1 month ago)
- Topics: discord, django, error-reporting
- Language: Python
- Size: 64.5 KB
- Stars: 22
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Discord Integration
Discord integration for Django, supporting error reporting via webhooks.
This app comes with two message handlers: `DiscordMessageHandler` and `SimpleDiscordMessageHandler`. `DiscordMessageHandler` sends all the information related to the message, such as a traceback if there is one, while the `SimpleDiscordMessageHandler` only sends the title.
## Installation
```bash
$ pip install django-discord-integration
```In your `settings.py`, add the following:
```python
INSTALLED_APPS = (
'discord_integration',
...
)
```Next, migrate the database:
```
$ python manage.py migrate
```Finally, create a Discord integration object in the Django admin site. Set the Discord webhook URL as well as the bot username and avatar URL if necessary. You can create multiple objects to direct different logs to different channels. The default object should the name `default`.
## Sample Logging Configuration
```python
LOGGING = {
'handlers': {
'discord_integration': {
'level': 'ERROR',
'class': 'discord_integration.log.DiscordMessageHandler',
'model_name': 'default', # OPTIONAL: specify a name to use a different integration configuration.
},
},
'loggers': {
'handlers': ['discord_integration'],
},
}
```