Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gsteixeira/django-except-catcher
Catch Django exceptions in production.
https://github.com/gsteixeira/django-except-catcher
django
Last synced: 23 days ago
JSON representation
Catch Django exceptions in production.
- Host: GitHub
- URL: https://github.com/gsteixeira/django-except-catcher
- Owner: gsteixeira
- License: other
- Created: 2018-08-31T13:38:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T16:28:05.000Z (almost 3 years ago)
- Last Synced: 2024-10-03T09:30:53.954Z (about 1 month ago)
- Topics: django
- Language: Python
- Homepage:
- Size: 124 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DJANGO EXCEPT CATCHER
------------------------django-except-catcher is a simple tool to catch and store exceptions and _500 errors_ in production django applications.
![django-except-catcher Logo](/except_catcher/static/except_catcher/logo.png)
When a _500 error_ happens a record with the details is stored in the database.
Exceptions are stored and listed so you can find similar errors and look their "yellow error page", just like in django's debug mode.
It doesn't require to run any daemon in order to work, just install a regular django module.
Inspired by django's AdminMailHandler.
For an example out of the box, take a look [here](https://github.com/gsteixeira/django-except-catcher-demo).
INSTALLATION
-------------Install django-except-catcher:
```shell
pip install django-except-catcher```
Add to urls.py:
```python
path('', include(('except_catcher.urls', 'except_catcher'), namespace="except_catcher"))```
add to settings.py:```python
INSTALLED_APPS = [
...
'except_catcher',
]LOGGING = {
'version': 1,
'handlers': {
'error_catcher': {
'level': 'ERROR',
'class': 'except_catcher.handlers.CatchExceptionHandler',
},
},
'loggers': {
'django.request': {
'handlers': [ 'error_catcher'],
'level': 'ERROR',
'propagate': False,
},
}
}```
run migrations:
```shell
./manage.py migrate except_catcher```
You can purposely throw an exception in the url (must be superuser):
http://localhost:8000/test-exception/
Now go to url:
http://localhost:8000/errors/
Only the superuser have access to these reports.