{"id":23566,"library":"django-cprofile-middleware","title":"django-cprofile-middleware","description":"A Django middleware that uses cProfile to profile views, triggered by a query parameter. Version 1.0.5 is the latest, with infrequent releases.","status":"active","version":"1.0.5","language":"python","source_language":"en","source_url":"https://github.com/omarish/django-cprofile-middleware/","tags":["django","middleware","profiling","cProfile"],"install":[{"cmd":"pip install django-cprofile-middleware","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Correct import path (note underscore in module name).","symbol":"cProfileMiddleware","correct":"from cprofile_middleware.middleware import cProfileMiddleware"}],"quickstart":{"code":"# settings.py\nMIDDLEWARE = [\n    ...\n    'cprofile_middleware.middleware.cProfileMiddleware',\n]\n\n# Add to a view's URL (optional for fine control):\n# ?prof to enable profiling","lang":"python","description":"Add the middleware to MIDDLEWARE and add ?prof to any URL to trigger profiling output."},"warnings":[{"fix":"Use the full dotted path as shown in quickstart, not a shorter alias.","message":"Using path-based import string instead of dotted class path may cause import errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Remove or guard the middleware in production if profiling should be disabled.","message":"Middleware does not require Django's debug mode; it can be used in production if the ?prof parameter is known.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install django-cprofile-middleware' and check spelling in imports.","cause":"Misspelled package name or forgot to install.","error":"ModuleNotFoundError: No module named 'cprofile_middleware'"},{"fix":"Add 'cprofile_middleware.middleware.cProfileMiddleware' to MIDDLEWARE and append ?prof to the URL.","cause":"Missing ?prof query parameter or middleware not registered properly.","error":"Profiling output not showing"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}