django-guid
Middleware that enables single request-response cycle tracing by injecting a unique ID into project logs
Decision gist · record as of 2026-08-14
Yes. This is a stable, actively maintained package with low install friction, no security vulnerabilities, and a clear, focused purpose. It integrates cleanly into Django's middleware stack and requires minimal configuration. Install it if you need to correlate logs across a single request or trace requests through a distributed system.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 3.1.1 or above for ASGI/WSGI support; earlier Django versions require django-guid 2.x with WSGI-only support.
- Low friction install with only two runtime dependencies (django and packaging).
- The package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — Licensed under MIT, a permissive open-source license with minimal restrictions on use, modification, and distribution.
last release 2026-05-05 (101 days) · last repo commit 2026-05-05 · 484 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 251,724 downloads/mo, #8,567 on PyPI
Alternatives
Verify before relying
pip install django-guid
# In settings.py:
INSTALLED_APPS = ['django_guid', ...]
MIDDLEWARE = ['django_guid.middleware.guid_middleware', ...]
LOGGING = {
'filters': {'correlation_id': {'()': 'django_guid.log_filters.CorrelationId'}},
'formatters': {'medium': {'format': '%(levelname)s [%(correlation_id)s] %(name)s %(message)s'}},
'handlers': {'console': {'class': 'logging.StreamHandler', 'filters': ['correlation_id']}}
}- Whether the package supports Django versions below 3.1.1 or only 3.1.1 and above as stated in the description
- Performance impact of correlation ID injection on high-throughput applications
- Compatibility with custom logging handlers beyond the standard configuration shown
What it is and what it does
Django GUID is middleware that injects a unique correlation ID into every request-response cycle and makes it available to your application's logging system. When configured, all log messages generated during a request automatically include that request's ID in brackets, allowing you to group and trace all logs belonging to a single user action or request across multiple functions, services, and middleware layers.
The package works with both ASGI and WSGI servers and stores the correlation ID using ContextVar for thread-safe access. It can accept an incoming correlation ID from a request header (validating it as a UUID if configured), generate a new one if none is provided, and optionally return the ID in the response headers. It also supports integrations with tools like Sentry to synchronize the correlation ID with external tracing systems.
Use it for
- Debugging production issues by filtering logs for a single user's request ID to see the full execution path
- Correlating logs across microservices when a correlation ID is passed between services in request headers
- Integrating with Sentry or similar error tracking to tag exceptions with the same request ID used in application logs
- Auditing and compliance: tracking which requests touched which data by following the correlation ID through logs
- Performance analysis: identifying slow requests by tracing all operations within a single correlation ID
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a stable, actively maintained package with low install friction, no security vulnerabilities, and a clear, focused purpose. It integrates cleanly into Django's middleware stack and requires minimal configuration. Install it if you need to correlate logs across a single request or trace requests through a distributed system.
Install
django-guid on PyPI
Before you install
Low friction install with only two runtime dependencies (django and packaging). The package is actively maintained with a recent release and no known vulnerabilities.
Requires Django 3.1.1 or above for ASGI/WSGI support; earlier Django versions require django-guid 2.x with WSGI-only support.
License in practice
Licensed under MIT, a permissive open-source license with minimal restrictions on use, modification, and distribution.
Quickstart
pip install django-guid
# In settings.py:
INSTALLED_APPS = ['django_guid', ...]
MIDDLEWARE = ['django_guid.middleware.guid_middleware', ...]
LOGGING = {
'filters': {'correlation_id': {'()': 'django_guid.log_filters.CorrelationId'}},
'formatters': {'medium': {'format': '%(levelname)s [%(correlation_id)s] %(name)s %(message)s'}},
'handlers': {'console': {'class': 'logging.StreamHandler', 'filters': ['correlation_id']}}
}
Verify before relying
- Whether the package supports Django versions below 3.1.1 or only 3.1.1 and above as stated in the description
- Performance impact of correlation ID injection on high-throughput applications
- Compatibility with custom logging handlers beyond the standard configuration shown
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesdjangopackaging |
| Maintenance | Actively maintained 101 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 251,724 / month, #8,567 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Internet :: WWW/HTTP :: WSGITopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python Modules |
Evidence: django_guid-3.6.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “correlation id logging”
- django-guidAttaches a unique correlation ID to all logs for every Django…
- asgi-correlation-idASGI middleware that reads or generates correlation IDs for incoming…
- django-cidAssigns unique correlation IDs to incoming HTTP requests and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also asgi-correlation-id · django-cid · django-request-id · py-machineid · django-log-request-id · drf-api-logger · eliot · flask-request-id-header · django-eventstream · django-dirtyfields