Skip to main content

django-requests-logger

django-requests-logger is a Django application used as a hook for Requests.

It logs every request made using the Requests library to the database and provides basic data masking for sensitive information.

You can access the logs in the Django admin site.

Installing

pip install django-requests-logger

Add django_requests_logger in INSTALLED_APPS.

Run python manage.py migrate

Usage

import requests
from django_requests_logger.callbacks import logger as requests_logger
from functools import partial

# If you want to capture only errors (HTTP 4XX client errors and 5XX server errors), then pass only_errors argument set to True.

hooks = {"response": partial(requests_logger, only_errors=True)}
requests.get('https://httpbin.org/', hooks=hooks)

TODO

Integrate this application in the Django logging as a handler.

Requirements

If you want to add yourself some functionality to the application:

  1. Fork it ( https://github.com/GearPlug/django-requests-logger )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Adds my new feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Metadata

Release files for django-requests-logger 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-requests-logger 1.0.0
File Size Uploaded
django_requests_logger-1.0.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-requests-logger 1.0.0
File Interpreter ABI Platform
django_requests_logger-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / django_requests_logger-1.0.0.tar.gz

Download URL django_requests_logger-1.0.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
28c224409e0de73a437ae9baf1d41620338756570c106281321ac108d70b2635
BLAKE2b-256 checksum
How to use checksums
b024dde2cda9c7f67b7743df03e393570ba054ea80888cf160309b858ec07a27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / django_requests_logger-1.0.0-py3-none-any.whl

Download URL django_requests_logger-1.0.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f93b5dbbba4746d692017459032e81b9df878b9e4323553010c0f29414748b47
BLAKE2b-256 checksum
How to use checksums
b3843fe75e1979d9c7eb16ec291758836ccab2b519a1179a1e1a658cd563661b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

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