Django python exception model, admin, logging handler, middleware and excepthook
Project description
Installation
$ pip install django-command-exception
settings.py
INSTALLED_APPS+=['django_command_exception']
migrate
$ python manage.py migrate
Models
model | table | columns/fields |
---|---|---|
CommandException |
django_command_exception |
id,command,exc_class,exc_message,exc_traceback,created_at |
Examples
call_command
from django_command_exception.models import CommandException
try:
call_command(name)
except Exception as e:
CommandException(command=name).save()
BaseCommand
from django_command_exception.models import CommandException
class BaseCommand(BaseCommand):
def execute(self, *args, **options):
try:
return super().execute(*args, **options)
except Exception as e:
CommandException(command=type(self).__module__.split('.')[-1]).save()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django_command_exception-1.0.1.tar.gz
.
File metadata
- Download URL: django_command_exception-1.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d4f5e3b16b516cedcd4f90dfc84bdc5bf481253f0bcc97ca3ebacc885ffe6f1 |
|
MD5 | ae739b0830b89475f1831e8d30ee48cd |
|
BLAKE2b-256 | d1722fc5b08288f0fbdf8c5a030b97f696c8972a69eb0e25faa0d86595e50f03 |