Metadata-Version: 2.2
Name: django-access-logging
Version: 1.0.1
Summary: Django middleware to log all requests and responses to a database.
Home-page: https://github.com/ross-sharma/django-access-logging
Author: Ross Sharma
Author-email: ross@ross-sharma.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: summary

# django-access-logging
Django middleware to log all requests and responses to a database.

<a id="installation"></a>
## Installation
Using `pip`
```commandline
pip install django-access-logging
```

In your project's `settings.py` file, add `django_access_logging`to `INSTALLED_APPS`:
```python
INSTALLED_APPS = [
    # ...
    "django_access_logging",
]
```
Then, create the database tables by running ```migrate```:
```commandline
python manage.py migrate
```

## Usage
### Viewing logged data
After installing and restarting the server, logged data can be viewed within `Access log entries` 
section of Django admin interface. See screenshots below:

[<img src="https://github.com/ross-sharma/django-access-logging/blob/main/img/admin.jpg?raw=true" width="200"/>](https://github.com/ross-sharma/django-access-logging/blob/main/img/admin.jpg?raw=true)
[<img src="https://github.com/ross-sharma/django-access-logging/blob/main/img/detail.jpg?raw=true" width="200"/>](https://github.com/ross-sharma/django-access-logging/blob/main/img/detail.jpg?raw=true)

### Ignoring specific IP prefixes
To ignore logging for specific IP addresses, add them to the `Ignored Ip Prefixes` model in the Django admin interface.
For example, adding `192.`, will ignore all IP addresses starting with `192.`.
