Skip to main content

Catch Exceptions in production

Project description

DJANGO EXCEPT CATCHER

django-except-catcher is a simple tool to catch and view exceptions in a production django website.

django-except-catcher Logo

Exceptions are stored and listed so you can find similar errors and look their "yellow error page", just like in django's debug error page.

It does not require instalation of any daemon in order to work, just install a regular django module.

Inspired in django's AdminMailHandler.

For an example out of the box, take a look here.

INSTALATION

Install django-except-catcher:

   pip install django-except-catcher

Add to urls.py:

   path('', include(('except_catcher.urls', 'except_catcher'), namespace="except_catcher"))

add to settings.py:

    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:

   ./manage.py migrate except_catcher

Now go to url:

http://localhost:8000/errors/

You can purposely throw an exception in the url:

http://localhost:8000/test-exception/

Only the superuser have access to these reports.

Sure, the UI is ugly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-except-catcher-1.0.0.tar.gz (31.7 kB view hashes)

Uploaded Source

Built Distribution

django_except_catcher-1.0.0-py3-none-any.whl (35.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page