{ "info": { "author": "Mark Longair", "author_email": "mark@mysociety.org", "bugtrack_url": null, "classifiers": [], "description": "This package provides a simple context manager for Django applications\nthat will output the SQL queries caused by a block of code to standard\noutput.\n\n(To pre-empt a common question: Django Debug Toolbar lets you see the\nqueries caused by HTTP requests to your application, but often I want to\ntrack down the queries that are used in a management command or some\nother context than making requests in your browser; the ``show_queries``\ncontext manager in this package helps in those other situations.)\n\n.. warning:: Please be aware that DEBUG will be set to True\n throughout the block (and restored to its previous\n value afterwards), so this shouldn't be used in\n production, for example.\n\nIf you have sqlparse installed, then the SQL will be pretty-printed to\nmake them easier to read, so I'd recommend that you also do:\n\n::\n\n pip install sqlparse\n\nExample\n~~~~~~~\n\n::\n\n from django_debug_queries import show_queries\n\n ...\n\n with show_queries():\n people = list(Person.objects.filter(date_of_birth__gt=\"2000-01-01\") \\\n .values('id', 'legal_name'))\n sessions = list(ParliamentarySession.objects.all())\n\nThis might output the following to standard output:\n\n::\n\n\n --===--\n Number of queries: 2\n Query 0 (taking 0.003):\n SELECT \"core_person\".\"id\",\n \"core_person\".\"legal_name\"\n FROM \"core_person\"\n WHERE \"core_person\".\"date_of_birth\" > '2000-01-01'\n ORDER BY \"core_person\".\"sort_name\" ASC\n Query 1 (taking 0.005):\n SELECT \"core_parliamentarysession\".\"id\",\n \"core_parliamentarysession\".\"created\",\n \"core_parliamentarysession\".\"updated\",\n \"core_parliamentarysession\".\"start_date\",\n \"core_parliamentarysession\".\"end_date\",\n \"core_parliamentarysession\".\"house_id\",\n \"core_parliamentarysession\".\"position_title_id\",\n \"core_parliamentarysession\".\"mapit_generation\",\n \"core_parliamentarysession\".\"name\",\n \"core_parliamentarysession\".\"slug\"\n FROM \"core_parliamentarysession\"\n ORDER BY \"core_parliamentarysession\".\"start_date\" ASC\n End of query output.\n\nOther options\n~~~~~~~~~~~~~\n\nLong query strings can take a long time to pretty-print using sqlparse,\nso by default SQL that is longer that 2048 characters is not formatted;\nyou can adjust that limit with the optional ``sqlparse_character_limit``\nparameter, e.g.:\n\n::\n\n with show_queries(sqlparse_character_limit=8192):\n ...\n\nIf you are using multiple databases in your Django application, you can\ntell this to use a particular database with the optional ``db_alias``\nparameter, e.g.\n\n::\n\n with show_queries(db_alias='my_other_db'):\n ...\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "django debugging sql debug queries", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-debug-queries", "package_url": "https://pypi.org/project/django-debug-queries/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-debug-queries/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-debug-queries/0.0.7/", "requires_dist": null, "requires_python": null, "summary": "A context manager for printing Django SQL queries to the terminal", "version": "0.0.7" }, "last_serial": 2206245, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "bee28538eb96a56a1b3838b265ce8ae2", "sha256": "ded07ade24e9d53cfc726df55b4acae006a7f11a4e9e3a0520ea03a8dbb65920" }, "downloads": -1, "filename": "django-debug-queries-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bee28538eb96a56a1b3838b265ce8ae2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1377, "upload_time": "2016-06-16T12:31:42", "url": "https://files.pythonhosted.org/packages/b8/f5/bca90a49fc10d6d31e9cbfa577e2632febd0b2632b5ed3e05fc849c62cf5/django-debug-queries-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "62257ed157245b2b19e84a6a866b34ba", "sha256": "63f4395991dfa3c921ad9bd6da7e776158cd34688540857398a2353932d9654a" }, "downloads": -1, "filename": "django-debug-queries-0.0.2.tar.gz", "has_sig": false, "md5_digest": "62257ed157245b2b19e84a6a866b34ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1434, "upload_time": "2016-06-16T12:41:09", "url": "https://files.pythonhosted.org/packages/c0/50/b2154a2d46b73fa3c6a0a7897cfe3fcc6a3dc22a702cb9a1b4ca886683fa/django-debug-queries-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "342f054667c16da5900d6fafbdb9af04", "sha256": "f3cd2edaa914896a823153d0dc86f1d18c2449dcbf4e8f55224fb61e350a4704" }, "downloads": -1, "filename": "django-debug-queries-0.0.3.tar.gz", "has_sig": false, "md5_digest": "342f054667c16da5900d6fafbdb9af04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1627, "upload_time": "2016-06-17T10:58:35", "url": "https://files.pythonhosted.org/packages/8e/c1/05b318f0a7ae44ed08e10a8e8a29e44e392bc3cf4f444db658fb4c0867cf/django-debug-queries-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "6fb13a2a6eb6ed4d57e0486cea346448", "sha256": "424861330fadb40c73db13f8613ee7c6983983281934dd99745443eb363d4d93" }, "downloads": -1, "filename": "django-debug-queries-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6fb13a2a6eb6ed4d57e0486cea346448", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3219, "upload_time": "2016-06-17T11:34:38", "url": "https://files.pythonhosted.org/packages/4f/2c/b8a4e5019c97fd5d31f3e7c965f1200775d1ae9efb88eb38f3476b8f6726/django-debug-queries-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "9551c25f9bf37d7ef94c3b3ec5d30432", "sha256": "0edd50bebbfc7f703d7f47e02300ae4f9e8b1b063b0c2074919285b818f5df19" }, "downloads": -1, "filename": "django-debug-queries-0.0.5.tar.gz", "has_sig": false, "md5_digest": "9551c25f9bf37d7ef94c3b3ec5d30432", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3454, "upload_time": "2016-06-17T12:19:50", "url": "https://files.pythonhosted.org/packages/d9/97/5add686ab748a5ff19af63e7505e1e3d7fbc93669b8fa425d7c6d22f08c0/django-debug-queries-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "704f46ceaadf480ba08a175e56105ae9", "sha256": "9cd65492f0e466710544883e281951f1b2ed22f0bed974725af04c6e40493a4b" }, "downloads": -1, "filename": "django-debug-queries-0.0.6.tar.gz", "has_sig": false, "md5_digest": "704f46ceaadf480ba08a175e56105ae9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3474, "upload_time": "2016-06-17T12:26:17", "url": "https://files.pythonhosted.org/packages/aa/69/3f2df77cb9af5f0aa68f8c5e22e22a0e78f0acd32e949da8462cc65cd4da/django-debug-queries-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "848a55d1b06703a55c78827dbbeb66cf", "sha256": "d4372619a7869023fd1fbf777c25cd7b33612421390861e68577caec82545bd2" }, "downloads": -1, "filename": "django-debug-queries-0.0.7.tar.gz", "has_sig": false, "md5_digest": "848a55d1b06703a55c78827dbbeb66cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3571, "upload_time": "2016-07-06T17:12:37", "url": "https://files.pythonhosted.org/packages/ee/b7/f9c394837dd420fd59c13a213382110f8355da616dbdcc90860c354bbedb/django-debug-queries-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "848a55d1b06703a55c78827dbbeb66cf", "sha256": "d4372619a7869023fd1fbf777c25cd7b33612421390861e68577caec82545bd2" }, "downloads": -1, "filename": "django-debug-queries-0.0.7.tar.gz", "has_sig": false, "md5_digest": "848a55d1b06703a55c78827dbbeb66cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3571, "upload_time": "2016-07-06T17:12:37", "url": "https://files.pythonhosted.org/packages/ee/b7/f9c394837dd420fd59c13a213382110f8355da616dbdcc90860c354bbedb/django-debug-queries-0.0.7.tar.gz" } ] }