--- id: django-cprofile-middleware version: "1.0.5" license: MIT license_treatment: permissive maintenance: abandoned --- # django-cprofile-middleware — Easily add cProfile profiling to django views. License: permissive · Maintenance: abandoned · Downloads: 90.2K/mo ## What it is and what it does django-cprofile-middleware is a Django middleware that wraps request handling with Python's cProfile profiler. When you add `?prof` to any URL while logged in as a staff user (by default), the middleware captures function-call timing data and displays it inline, letting you see which functions consumed the most CPU time during that request. It supports sorting results by different metrics and downloading the profile data for visualization in external tools. The middleware activates only when Django's DEBUG setting is True and (by default) when the requesting user has staff privileges. It's a development-only tool for identifying performance bottlenecks without manual instrumentation. Use it for: - Identify slow database queries or expensive function calls in a Django view during local development - Compare performance across different code paths by profiling the same endpoint with different parameters - Export profile data for detailed visualization of call hierarchies in external profiling viewers - Debug performance regressions by profiling a view before and after code changes ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Middleware that profiles Django view execution using cProfile and displays results inline when a query parameter is added to any request. No. The package is abandoned (last release 2020-02-20, last commit 2021-08-18) with no active maintenance or security updates. Modern Django and Python versions may have broken compatibility. For profiling Django views, prefer actively maintained alternatives. ## Install pip install django-cprofile-middleware uv add django-cprofile-middleware poetry add django-cprofile-middleware ## Installing django-cprofile-middleware Before you install: High install friction with no runtime dependencies. The package is abandoned—last commit was 2021-08-18 and last release 2020-02-20. No active maintenance or security updates. License in practice: MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions. Quickstart: # Install pip install django-cprofile-middleware # In settings.py, add to MIDDLEWARE: MIDDLEWARE = [ ..., 'django_cprofile_middleware.middleware.ProfilerMiddleware' ] # Then visit http://localhost:8000/your-view/?prof while logged in as staff Requires Django with DEBUG=True and (by default) an authenticated user with is_staff=True; compatibility with modern Django and Python versions is unverified Verify before relying: - Compatibility with modern Django versions (1.10+ middleware API is mentioned, but no upper bound specified) - Python version support is unspecified; may not work with recent Python releases - Whether the package works with Django's async views or only synchronous handlers ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 90.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django view profiling, cprofile middleware django, django performance bottleneck, django request profiling, django debug profiler, django view timing, django performance analysis, django-profiling, development-only, abandoned [View on SkillFed](https://skillfed.io/packages/django-cprofile-middleware) · [View on PyPI](https://pypi.org/project/django-cprofile-middleware/)