{ "info": { "author": "Omar Bohsali", "author_email": "me@omarish.com", "bugtrack_url": null, "classifiers": [ "Framework :: Django" ], "description": "# django-cprofile-middleware\n\n[![pypi-version]][pypi]\n\nThis is a simple profiling middleware for Django applications. I wrote it because I got tired of printing \"start\" \"stop\" \"stop 2\" in my programs to find the bottlenecks.\n\nI found a simple example on @dcramer's [slideshare](http://www.slideshare.net/zeeg/django-con-high-performance-django-presentation) and modified it to support sorting.\n\n## Installing\n\n```bash\n$ pip install django-cprofile-middleware\n```\n\nThen add ```django_cprofile_middleware.middleware.ProfilerMiddleware``` to the end your ```MIDDLEWARE``` in settings.py. This option was called ```MIDDLEWARE_CLASSES``` in versions of Django before [1.10](https://docs.djangoproject.com/en/1.10/topics/http/middleware/). \n\nFor example:\n\n```\nMIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'startup.do.work.FindProductMarketFitMiddleware',\n ...\n 'django_cprofile_middleware.middleware.ProfilerMiddleware'\n)\n```\n\n## Running & Sorting Results\n\nOnce you've installed it, log in as a user who has staff privileges and add ```?prof``` to any URL to see the profiler's stats. For example to see profile stats for ```http://localhost:8000/foo/```, visit ```http://localhost:8000/foo/?prof```.\n\nYou can also pass some options:\n\n**count:** The number of results you'd like to see. Default is 100.\n\n**sort:** The field you'd like to sort results by. Default is ```time```. For all the options you can pass, see the [docs for pstats](http://docs.python.org/2/library/profile.html#pstats.Stats.sort_stats).\n\n**download:** Download profile file, that can be visualized in multiple viewers, e.g. [SnakeViz](https://github.com/jiffyclub/snakeviz/) or [RunSnakeRun](http://www.vrplumber.com/programming/runsnakerun/)\n\n## Enjoy!\n\nEmail me with any questions: [omar.bohsali@gmail.com](omar.bohsali@gmail.com).\n\n\n[pypi]: https://pypi.org/project/django-cprofile-middleware/\n[pypi-version]: https://img.shields.io/pypi/v/django-cprofile-middleware.svg", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/omarish/django-cprofile-middleware/", "keywords": "django,profiling,cProfile", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-cprofile-middleware", "package_url": "https://pypi.org/project/django-cprofile-middleware/", "platform": "", "project_url": "https://pypi.org/project/django-cprofile-middleware/", "project_urls": { "Homepage": "https://github.com/omarish/django-cprofile-middleware/" }, "release_url": "https://pypi.org/project/django-cprofile-middleware/1.0.4/", "requires_dist": null, "requires_python": "", "summary": "Easily add cProfile profiling to django views.", "version": "1.0.4" }, "last_serial": 3921015, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "66fde871c5e74cf509383f86f6050708", "sha256": "53fac9fb2d4356d60cc87e2ba252ef42b8567bddd96bd879a8148e5e3b25a49f" }, "downloads": -1, "filename": "django-cprofile-middleware-0.1.tar.gz", "has_sig": false, "md5_digest": "66fde871c5e74cf509383f86f6050708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1497, "upload_time": "2013-09-01T21:41:54", "url": "https://files.pythonhosted.org/packages/f2/8c/a347e3fb2b4ebb1b94afcb5a801d8341a5fbc9299209a5d05424bc5fbe39/django-cprofile-middleware-0.1.tar.gz" } ], "0.2": [], "0.4": [ { "comment_text": "", "digests": { "md5": "0126a834a22dbd1fd50b53a76d507014", "sha256": "6ecfb5c2add1b2198d0c6e537f48461f228adbdb4a50ecc1e1cbd26de5afde1b" }, "downloads": -1, "filename": "django-cprofile-middleware-0.4.tar.gz", "has_sig": false, "md5_digest": "0126a834a22dbd1fd50b53a76d507014", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1691, "upload_time": "2017-03-04T03:36:06", "url": "https://files.pythonhosted.org/packages/aa/f8/47d57a8c0ed8cf72ec16d1670b3101ec3c8cfa0e12baefa453114a16ef3c/django-cprofile-middleware-0.4.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "0b087f0050a6b4c03bb6269ec5a939f3", "sha256": "2bb46c68675df9756b16523ca7e5b61cf0ebee5e595137da75fc2b990f370a53" }, "downloads": -1, "filename": "django-cprofile-middleware-1.0.tar.gz", "has_sig": false, "md5_digest": "0b087f0050a6b4c03bb6269ec5a939f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1755, "upload_time": "2017-10-18T20:13:00", "url": "https://files.pythonhosted.org/packages/cb/5e/e8db9c39e814a170db662cd436638c22a956f17018edc018a06fd0557413/django-cprofile-middleware-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7752f90fa09485b5dae6851855c9fbfd", "sha256": "66165aecd9e83905066a4927d59b0f8a645e388caa9e6a3038e5084a8c09b940" }, "downloads": -1, "filename": "django-cprofile-middleware-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7752f90fa09485b5dae6851855c9fbfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2955, "upload_time": "2018-05-31T23:53:07", "url": "https://files.pythonhosted.org/packages/3b/c2/0cb878b0018b54444849d4569c6b36e0688eb1316e363e356228bb5d1b0f/django-cprofile-middleware-1.0.1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "3cc0c05a3e9415ce4908d36a4c7cc50c", "sha256": "e64b21ee478d95ba66cf710d4d323b420a51e6700f51ab4d131baab215e558ad" }, "downloads": -1, "filename": "django-cprofile-middleware-1.0.3.tar.gz", "has_sig": false, "md5_digest": "3cc0c05a3e9415ce4908d36a4c7cc50c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3068, "upload_time": "2018-06-01T15:17:00", "url": "https://files.pythonhosted.org/packages/43/b2/5de76ba7246443a75b82d8e5914646b12b255c7bb21e9f34cbc93acf939f/django-cprofile-middleware-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "5517d0791535af247afc3e842d9b1ea8", "sha256": "66018212803d55d69df6856c67e521310a3e62189d91a72f374878d31ca0e17d" }, "downloads": -1, "filename": "django-cprofile-middleware-1.0.4.tar.gz", "has_sig": false, "md5_digest": "5517d0791535af247afc3e842d9b1ea8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3410, "upload_time": "2018-06-01T15:17:01", "url": "https://files.pythonhosted.org/packages/a9/7c/2f86bb99b8e16fc39d9b5f6f3d0eaf5a128e79d5a4a3b20450e388e4231c/django-cprofile-middleware-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5517d0791535af247afc3e842d9b1ea8", "sha256": "66018212803d55d69df6856c67e521310a3e62189d91a72f374878d31ca0e17d" }, "downloads": -1, "filename": "django-cprofile-middleware-1.0.4.tar.gz", "has_sig": false, "md5_digest": "5517d0791535af247afc3e842d9b1ea8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3410, "upload_time": "2018-06-01T15:17:01", "url": "https://files.pythonhosted.org/packages/a9/7c/2f86bb99b8e16fc39d9b5f6f3d0eaf5a128e79d5a4a3b20450e388e4231c/django-cprofile-middleware-1.0.4.tar.gz" } ] }