django-cid
Correlation IDs in Django for debugging requests
Decision gist · record as of 2026-08-14
Yes, if you use Django and need request tracing for debugging. The package is stable, has low install friction, and solves a real problem in multi-request logging scenarios. The dormant maintenance status is acceptable for a mature, feature-complete tool—no active vulnerabilities and it supports current Django and Python versions. Install it if request correlation is important to your logging strategy.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django >= 3.1 and Python >= 3.8.
- Low install friction with a single runtime dependency on django.
- Maintenance is dormant—no releases since May 2024, though the repository remains active and the package is marked Production/Stable.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is a permissive open-source license. You may use, modify, and distribute this package freely in commercial and private projects, provided you include the license text and do not hold the authors liable.
last release 2024-05-14 (822 days) · last repo commit 2024-05-14 · 46 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 129,263 downloads/mo, #11,676 on PyPI
Alternatives
Verify before relying
pip install django-cid
# In Django settings.py, add to MIDDLEWARE:
MIDDLEWARE = [
'django_cid.middleware.CIDMiddleware',
# ...
]
# Correlation ID is then available in logs and can be accessed via:
from django_cid import get_cid
cid = get_cid()- Whether the package works with Django versions beyond 4.2 (latest tested version in classifiers).
- Performance impact of automatic SQL query annotation on high-throughput applications.
- Compatibility with async Django views and middleware.
What it is and what it does
Django Correlation ID is a middleware package that assigns a unique identifier to each incoming HTTP request and propagates it through the Django request/response cycle. This correlation ID can be automatically embedded in all log messages, SQL query comments, rendered templates, and HTTP response headers, making it easy to trace which log entries belong to the same request when debugging multi-request scenarios.
The package solves the problem of log attribution in complex systems where multiple requests are processed concurrently. Instead of manually threading request IDs through your codebase, django-cid handles this automatically via middleware, allowing you to correlate all side effects of a single request without explicit plumbing. It's particularly useful in service-oriented architectures where you need to pass the correlation ID to downstream services.
Use it for
- Trace all log messages belonging to a single user request across multiple application components and services.
- Debug production issues by filtering logs by correlation ID to isolate the request that caused a problem.
- Include correlation IDs in SQL query comments to link database activity to specific HTTP requests.
- Pass correlation IDs to downstream microservices via HTTP headers to maintain request tracing across service boundaries.
- Render correlation IDs in error pages or response headers for customer support reference.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Django and need request tracing for debugging.
The package is stable, has low install friction, and solves a real problem in multi-request logging scenarios. The dormant maintenance status is acceptable for a mature, feature-complete tool—no active vulnerabilities and it supports current Django and Python versions. Install it if request correlation is important to your logging strategy.
Install
django-cid on PyPI
Before you install
Low install friction with a single runtime dependency on django. Maintenance is dormant—no releases since May 2024, though the repository remains active and the package is marked Production/Stable. Suitable for stable projects that don't require frequent updates.
Requires Django >= 3.1 and Python >= 3.8.
License in practice
BSD-3-Clause is a permissive open-source license. You may use, modify, and distribute this package freely in commercial and private projects, provided you include the license text and do not hold the authors liable.
Quickstart
pip install django-cid
# In Django settings.py, add to MIDDLEWARE:
MIDDLEWARE = [
'django_cid.middleware.CIDMiddleware',
# ...
]
# Correlation ID is then available in logs and can be accessed via:
from django_cid import get_cid
cid = get_cid()
Verify before relying
- Whether the package works with Django versions beyond 4.2 (latest tested version in classifiers).
- Performance impact of automatic SQL query annotation on high-throughput applications.
- Compatibility with async Django views and middleware.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedjango |
| Maintenance | Dormant 822 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 129,263 / month, #11,676 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/StableFramework :: DjangoFramework :: Django :: 3Framework :: Django :: 3.1Framework :: Django :: 3.2Framework :: Django :: 4Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: django_cid-3.0-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 › “django request correlation id”
- django-cidAssigns unique correlation IDs to incoming HTTP requests and…
- django-guidAttaches a unique correlation ID to all logs for every Django…
- django-request-idAttaches a unique request ID to each Django HTTP request and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also django-guid · asgi-correlation-id · django-queryinspect · django-log-request-id · django-request-logging · Flask-Log-Request-ID · eliot · django-dirtyfields · django-cors-headers · opencensus-ext-logging