Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sirrobot01/django-request-viewer
Log and View requests made on Django
https://github.com/sirrobot01/django-request-viewer
django python
Last synced: 2 days ago
JSON representation
Log and View requests made on Django
- Host: GitHub
- URL: https://github.com/sirrobot01/django-request-viewer
- Owner: sirrobot01
- License: mit
- Created: 2021-03-29T10:02:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-20T22:15:25.000Z (about 2 months ago)
- Last Synced: 2025-01-02T16:13:41.636Z (9 days ago)
- Topics: django, python
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 27
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Request Viewer
Log and view requests and exceptions made on your Django App
#### Updates 17th, January 2022
- Adds Exception logger
- Cleaned up the code### Introduction
Recently, [@ichtrojan](https://github.com/ichtrojan) and [@toniastro](https://github.com/toniastro) released [horus](https://github.com/ichtrojan/horus), a request logger and viewer for Go. Then I felt the need for something like that for the Django community.
### Installation
Install using pip
```bash
pip install django-request-viewer
```### Usage
Add `'request-viewer'` to your `INSTALLED_APPS` in settings.py.
INSTALLED_APPS = [
...
'request_viewer',
...
]
Add `'request_viewer.middleware.RequestViewerMiddleware'` to your MIDDLEWARE list in settings.py.MIDDLEWARE = [
...
'request_viewer.middleware.RequestViewerMiddleware',
...
]##### To log exceptions, add
Add `'request_viewer.middleware.ExceptionMiddleware'` to your MIDDLEWARE list in settings.py.
MIDDLEWARE = [
...
'request_viewer.middleware.ExceptionMiddleware',
...
]
Add `'request-viewer'` to your main urls.pyurlpatterns = [
...
path('logs/', include('request_viewer.urls'))
...
]
Run migrations, `python manage.py migrate request_viewer`
**OPTIONAL**Add `REQUEST_VIEWER` dictionary to your settings.py.
**LIVE_MONITORING**: Default: `True`, False to pause monitoring.
**WHITELISTED_PATH**: Default: `[]`, This is a list of paths to be excluded when monitoring
{
"LIVE_MONITORING": True,
"WHITELISTED_PATH": ['admin/']
}
**Note**: Media url, Static url and request-viewer url are automatically excluded.### Start your server and head to http://localhost:8000/logs/request-viewer to view requests
### Head to http://localhost:8000/logs/request-viewer/exceptions to view exceptions
View your request logs.
### Contribute
Well, no big drama, fork the repo and make pull requests, easy-peasy, right?
### TODO
* JSON export
* Caching
* Create an African unicorn
* Buy a yacht### Credits
* Toni Akinmolayan - [twitter](https://twitter.com/toniastro_) [GitHub](https://github.com/toniastro)
* Michael Trojan Okoh - [twitter](https://twitter.com/ichtrojan) [GitHub](https://github.com/ichtrojan)### Follow me (I am not boring, I promise)
* [Twitter](https://twitter.com/sirrobot01)
* [Github](https://github.com/sirrobot01)