Metadata-Version: 2.4
Name: bear-django-query-profiler
Version: 0.1.0
Summary: A simple Django middleware to log SQL queries during development.
Author-email: Bohdan Riabunets <bearablyk@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/bearablyk/django-query-profiler
Project-URL: Issues, https://github.com/bearablyk/django-query-profiler/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Framework :: Django
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Topic :: System :: Logging
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: Django>=3.2

# Django Query Profiler

A simple Django middleware to log SQL queries executed during a request. This middleware is active only when `DEBUG = True`.

## Installation

```bash
pip install bear-django-query-profiler
```

## Usage

1.  Add the middleware to your `MIDDLEWARE` list in `settings.py`. It should be placed after any other middleware that might generate queries.

    ```python
    # settings.py
    MIDDLEWARE = [
        # ... other middleware
        'query_profiler.middleware.QueryProfilerMiddleware',
    ]
    ```

2.  (Optional) You can specify a list of string patterns to ignore in the logs. Any query containing one of these patterns will not be logged.

    ```python
    # settings.py
    QUERY_PROFILER_IGNORE_PATTERNS = ['global_system_logs', 'django_session']
    ```

3.  Ensure your logging is configured to display `DEBUG` level messages.
