Registry / web-framework / django-cprofile-middleware

django-cprofile-middleware

JSON →
library1.0.5pypypiunverified

A Django middleware that uses cProfile to profile views, triggered by a query parameter. Version 1.0.5 is the latest, with infrequent releases.

pip install django-cprofile-middleware
INSTALL
IMPORT
SIG · DJANGO-CPROFILE-MI
D
django-cprofile-middleware
web-frameworkpythonv1.0.5
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cProfileMiddleware
from django_cprofile_middleware import cProfileMiddleware
from cprofile_middleware.middleware import cProfileMiddleware

Add the middleware to MIDDLEWARE and add ?prof to any URL to trigger profiling output.

# settings.py MIDDLEWARE = [ ... 'cprofile_middleware.middleware.cProfileMiddleware', ] # Add to a view's URL (optional for fine control): # ?prof to enable profiling
Debug
Known issues
gotchaUsing path-based import string instead of dotted class path may cause import errors.
fix
Use the full dotted path as shown in quickstart, not a shorter alias.
affects: all
gotchaMiddleware does not require Django's debug mode; it can be used in production if the ?prof parameter is known.
fix
Remove or guard the middleware in production if profiling should be disabled.
affects: all
Upgrade
Version history
1.0.5latest on PyPI · released Feb 20, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
2
Amazon
1
Resources
django-cprofile-middleware — pip install django-cprofile-middleware · libregistry