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 Provenance Actions
django_requests_logger-1.0.0.tar.gz 4.1 kB Without provenance Details for django_requests_logger-1.0.0.tar.gz

Built distribution (wheel)

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

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

Security for django-requests-logger 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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