Skip to main content

Installation

$ pip install django-exception

settings.py

INSTALLED_APPS+=['django_exception']

migrate

$ python manage.py migrate

Models/tables

model table columns/fields
ExceptionModel django_exception id,module,filename,lineno,exc_class,exc_message,exc_traceback,timestamp

Examples

settings.py

LOGGING = {
    "version": 1,
    "handlers": {
        "console": {
            "level": "DEBUG",
            "class": "logging.StreamHandler",
        },
        "django_exception": {
            "level": "ERROR",
            "class": "django_exception.ExceptionLogHandler",
        }
    },
    "root": {
        "handlers": ["console", "django_exception"],
        "level": "DEBUG",
    },
    "loggers": {
        "django_exception": {
            "level": "ERROR",
            "handlers": ["django_exception"],
            "propagate": True,
        },
    },
}

MIDDLEWARE = [
    "django_exception.middleware.ExceptionMiddleware",
]

sys.excepthook - log all exceptions

import sys
import django_exception

def excepthook(exc_type, exc_message, tb):
	django_exception.excepthook(exc_type, exc_message, tb)
	raise exc_type(exc_message)

sys.excepthook = excepthook

Metadata

Release files for django-exception 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-exception 1.0.0
File Size Uploaded
django-exception-1.0.0.tar.gz 3.3 kB Details

Release files / django-exception-1.0.0.tar.gz

Download URL django-exception-1.0.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
714319944b52b53d4a26fbd1e4f5761482a16e96925f3e28ae43abdb46da7f52
BLAKE2b-256 checksum
How to use checksums
c8237de4a878da04e0fe1e3299b435263d9203bd78aef43d46e50924d9291941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page