Application that logs errors generated in a web system into a model. The model is displayed in the administrator.
Project description
Application that logs errors generated in a web system into a model. The model is displayed in the administrator.
Installing
pip install django-admin-log
Quick start
Include the app ‘log’ to INSTALLED_APPS in the settings.py
Apply migration with migrate for registry the model of django-seo-admin:
python manage.py migrate
Run server
How to use?
For example, to record an error
In the views.py:
from log.utils import set_error_to_log def myview(request, pk): try: raise "Error auto generate" except Exception, e: set_error_to_log(request, str(e))
When occurs on error, go the administrator and visualize the record in the model.
For example, for get errors loaded on a date
In the views.py:
from log.utils import get_data_log def myview(request, pk): now = datetime.datetime.now() data = get_data_log('date', now) content = data[0].content return HttpResponse(content)
In this example, i’m getting errors from field date with the value now. Then getting the first value. Other field can be username.
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-admin-log-0.2.tar.gz
.
File metadata
- Download URL: django-admin-log-0.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 416b9749047599f1ec1b67ff52c3ff580219cd9d056879408ca546f9b93eabae |
|
MD5 | 7b27d97b93af7600ad46e1edb10fa810 |
|
BLAKE2b-256 | cc7c6622751756c90d367f9df61db3e30ee01ccfd3617219f368dfa07e6658e7 |