Log outgoing requests made by the requests python library
Project description
1 django-log-outgoing-requests
- Version:
0.1.0
- Source:
- Keywords:
logging
- PythonVersion:
3.9
Log and save outgoing requests made by requests library
2 Features
Log outgoing requests
Save logs in database
Overview of the saved logs in the admin page
3 Installation
3.1 Requirements
Python 3.7 or above
setuptools 30.3.0 or above
Django 3.2 or newer
3.2 Install
pip install django-log-outgoing-requests
4 Usage
To use this with your project you need to follow these steps:
Add Django Log Outgoing Requests to INSTALLED_APPS in your Django project’s settings.py:
INSTALLED_APPS = ( # ..., "log_outgoing_requests" )
Update your settings.py file with the following (if you haven’t defined logging yet, you can see the Django’s documentation):
from log_outgoing_requests.formatters import HttpFormatter LOGGING = { #..., "formatters": { #..., "outgoing_requests": {"()": HttpFormatter}, }, "handlers": { #..., "log_outgoing_requests": { "level": "DEBUG", "formatter": "outgoing_requests", "class": "logging.StreamHandler", }, "save_outgoing_requests": { "level": "DEBUG", "class": "log_outgoing_requests.handlers.DatabaseOutgoingRequestsHandler", }, }, "loggers": { #..., "requests": { "handlers": ["log_outgoing_requests", "save_outgoing_requests"], "level": "DEBUG", "propagate": True, }, }, } LOG_OUTGOING_REQUESTS_DB_SAVE = True # save logs enabled/disabled based on the boolean value
Run the migrations
python manage.py migrate
5 Local development
To install and develop the library locally, use:
pip install -e --no-build-isolation .[tests,coverage,docs,pep8,release]
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
Built Distribution
Close
Hashes for django-log-outgoing-requests-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98d42de856e4c1e67362d5cffc64d7fcd0d6622017ddcd5d24c2faf9253e905b |
|
MD5 | 65bfdeaa8149121c7492d494708d6c41 |
|
BLAKE2b-256 | f4c7790198b7aa04e737c109a7ff11d5ebd06cc18898c85e3105bbb9997da061 |
Close
Hashes for django_log_outgoing_requests-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 093e07386737a44a73eed6f5cdddfdce9b01c7553a119aa87531a8d0912338a5 |
|
MD5 | 20071566b055fbabba2200ab1edb9b35 |
|
BLAKE2b-256 | 40104e8682732c394f1fe6e90a49852732fbdc0f15c1abdfe2916d90c11a6a57 |