{ "info": { "author": "Erik van Zijst", "author_email": "erik.van.zijst@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Debuggers", "Topic :: System :: Monitoring", "Topic :: Utilities" ], "description": "Django Timelimit\n================\n\nDjango-timelimit allows you to wrap sections of Django templates with a\ntimeout to enforce an upper bound on render time. When the templates exceeds\nthis time, an alternative fragment is rendered instead::\n\n {% load timelimit %}\n\n {% timelimit 0.05 %}\n {# perform a potentially very slow operation #}\n

No timeout occurred

\n {% sleep 0.5 %}\n {% else %}\n

Sorry, couldn't render the fragment in time.

\n {% endtimelimit %}\n\n\nInstallation\n------------\n::\n\n $ pip install django-timelimit\n\n\nReentrant\n---------\n\nDjango-timelimit is fully reentrant, which means that you can have nested\ntimeouts::\n\n {% load timelimit %}\n\n {% timelimit 0.10 %}\n {# perform a potentially very slow operation #}\n\n {% timelimit 0.05 %}\n {# perform another potentially slow operation #}\n {% else %}\n

Sorry, couldn't render the nested fragment in time.

\n {% endtimelimit %}\n\n

No timeout occurred

\n {% else %}\n

Sorry, couldn't render the fragment in time.

\n {% endtimelimit %}\n\nNested timeouts allow a large outer timeout to contain smaller timeouts. If the\ninner timeout is larger than the outer timeout, it is treated as a no-op.\n\n\nQuotas\n------\n\nInterruptingcow quotas (introduced in interruptingcow 0.7) are supported too,\nallowing you to share a single allocation of time between different timelimit\ntags::\n\n {% load timelimit %}\n\n {% for foo in bar %}\n {% timelimit quota_var %}\n ...\n {% else %}\n ...\n {% endtimelimit %}\n {% endif %}\n\nThis is useful in loops where you do not want the total render time to go up\nwith the number of iterations of the loop.\n\n\nCaveats\n-------\n\nDjango-timelimit is based on interruptingcow and so it shares its limitations.\nInterruptingcow uses ``signal(SIGALRM)`` to let the operating system interrupt\nprogram execution, meaning:\n\n1. Python signal handlers only apply to the main thread, so you cannot use this\n from other threads (this also means you cannot use this in a multithreaded\n webserver, or even ones that use a background thread for request handling\n (Gunicorn works great).\n2. You must not use this in a program that uses ``SIGALRM`` itself (this\n includes certain profilers)\n", "description_content_type": "", "docs_url": null, "download_url": "https://bitbucket.org/evzijst/django-timelimit/downloads/django-timelimit-0.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/evzijst/django-timelimit", "keywords": "django debug watchdog timer timelimit timeout interrupt interruptingcow", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-timelimit", "package_url": "https://pypi.org/project/django-timelimit/", "platform": "", "project_url": "https://pypi.org/project/django-timelimit/", "project_urls": { "Download": "https://bitbucket.org/evzijst/django-timelimit/downloads/django-timelimit-0.3.tar.gz", "Homepage": "https://bitbucket.org/evzijst/django-timelimit" }, "release_url": "https://pypi.org/project/django-timelimit/0.3/", "requires_dist": null, "requires_python": "", "summary": "A Django template tag used to enforce render time limits within templates.", "version": "0.3" }, "last_serial": 5359909, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "814f0aad4a3dc1f1c119882a4fe28698", "sha256": "d798cabe449505e1ddff2eef4c38084c4dc983de59b501dd437fa75fa7bf4179" }, "downloads": -1, "filename": "django-timelimit-0.1.tar.gz", "has_sig": false, "md5_digest": "814f0aad4a3dc1f1c119882a4fe28698", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3761, "upload_time": "2013-09-10T22:47:47", "url": "https://files.pythonhosted.org/packages/e0/c2/cc534ead9b23f5cf4c1add26ae8edbcb3945cc6228d34a3180dac6f974a0/django-timelimit-0.1.tar.gz" } ], "0.2-rc1": [ { "comment_text": "", "digests": { "md5": "2041be88294a4ef13fafa8e1911e99fe", "sha256": "05d297109e9113e278bb72226bc2de08b39ae03dbbd44b6926941267dabaa45a" }, "downloads": -1, "filename": "django-timelimit-0.2-rc1.tar.gz", "has_sig": false, "md5_digest": "2041be88294a4ef13fafa8e1911e99fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3736, "upload_time": "2019-06-04T22:31:39", "url": "https://files.pythonhosted.org/packages/b5/61/83069fd581f2fac94e449aa9e3da419e5c0c179e8a8fed862d0febfc959e/django-timelimit-0.2-rc1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "89a31b50e031694c80651ec2fcf295a6", "sha256": "9ed268ba2e4db3bc6f4b47607f6de760c33a1e3fbf46e701e83d6dc2ba05f720" }, "downloads": -1, "filename": "django-timelimit-0.3.tar.gz", "has_sig": false, "md5_digest": "89a31b50e031694c80651ec2fcf295a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3722, "upload_time": "2019-06-04T22:36:48", "url": "https://files.pythonhosted.org/packages/5a/81/2ea227f4d66bd05241c11e380bd875f229316e771789da42a154fd30e184/django-timelimit-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "89a31b50e031694c80651ec2fcf295a6", "sha256": "9ed268ba2e4db3bc6f4b47607f6de760c33a1e3fbf46e701e83d6dc2ba05f720" }, "downloads": -1, "filename": "django-timelimit-0.3.tar.gz", "has_sig": false, "md5_digest": "89a31b50e031694c80651ec2fcf295a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3722, "upload_time": "2019-06-04T22:36:48", "url": "https://files.pythonhosted.org/packages/5a/81/2ea227f4d66bd05241c11e380bd875f229316e771789da42a154fd30e184/django-timelimit-0.3.tar.gz" } ] }