{ "info": { "author": "Mathieu Pillard", "author_email": "mpillard@mozilla.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Environment :: Web Environment :: Mozilla", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-post-request-task\n========================\n\n.. image:: https://travis-ci.org/mozilla/django-post-request-task.svg?branch=master\n :target: https://travis-ci.org/mozilla/django-post-request-task\n\nA celery 3.x task class whose execution is delayed until after the request\nfinishes, using ``request_started`` and ``request_finished`` signals from django\nand thread locals.\n\nThis is useful if your views are wrapped in transactions (as they should if\nyou're making database modifications in them), as you can end up triggering a\ncelery task too soon before the transaction has been committed (or even trigger\na task when the corresponding transaction has been rolled back).\n\nBy listening to the `request_started` and `request_finished` django signals, we\ncan safely trigger a task after all transactions created from ``@atomic`` or\n``ATOMIC_REQUESTS`` have been committed.\n\nUsage\n-----\n\n.. code-block:: python\n\n from celery import Celery\n from post_request_task.task import PostRequestTask\n\n\n app = Celery('myapp', task_cls=PostRequestTask)\n\n @app.task\n def my_task():\n # If .delay() is called on this task inside a django request-response\n # cycle it will be called once the request is finished, and not before.\n pass\n\n\nOr, if you are using the task decorator directly:\n\n.. code-block:: python\n\n from post_request_task.task import task\n\n @task\n def my_task():\n pass\n\n\nThat's it. If the task is called from outside the django request-response\ncycle, then it will be triggered normally.\n\nAs a bonus feature, if the same task is called with the same argument several\ntimes during a request-response cycle, it will only be queued up once.\n\n\nRunning tests\n-------------\n\n.. code-block:: sh\n\n $ make testenv\n $ make test\n\nBy default, tests are run with whatever django version is installed. If you want to run tests for other versions\nuse tox:\n\n\n.. code-block:: sh\n\n $ make testenv\n $ tox -e 2.7-1.11.x # or any other environment defined in our tox.ini\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mozilla/django-post-request-task", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-post-request-task", "package_url": "https://pypi.org/project/django-post-request-task/", "platform": "", "project_url": "https://pypi.org/project/django-post-request-task/", "project_urls": { "Homepage": "http://github.com/mozilla/django-post-request-task" }, "release_url": "https://pypi.org/project/django-post-request-task/0.4.1/", "requires_dist": [ "Django (>=1.11)", "celery (<5.0,>=3.0)", "coverage; extra == 'tests'", "flake8; extra == 'tests'", "mock; extra == 'tests'" ], "requires_python": "", "summary": "A celery task class whose execution is delayed until after the request finishes", "version": "0.4.1" }, "last_serial": 5769532, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "51482dbbbc9a8019b29c5f15ab91ed5e", "sha256": "7fb2ea760aa73e97a25564255dd08c7ed16f9e8f1370e601e79c7005555ae94e" }, "downloads": -1, "filename": "django_post_request_task-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "51482dbbbc9a8019b29c5f15ab91ed5e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7377, "upload_time": "2016-01-28T17:47:48", "url": "https://files.pythonhosted.org/packages/7e/f2/9147e38e59075df90e83c4599ab0070af91ae92b62e8a8598e5ba2fc310d/django_post_request_task-0.0.2-py2-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "6246cfc359f98e8e46512242fd8b5cfb", "sha256": "6e925e40d05ed9c51c59ec7083d4d0277db88670bbd58151c72eebc0f93be3ca" }, "downloads": -1, "filename": "django_post_request_task-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "6246cfc359f98e8e46512242fd8b5cfb", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7519, "upload_time": "2016-02-01T12:28:57", "url": "https://files.pythonhosted.org/packages/02/c3/707d495bc6163d9006d72953669478fbbd8b65d3f7ba52652f6956f78998/django_post_request_task-0.0.3-py2-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "603016de6024069c8f835f727e37aadf", "sha256": "f5b0d532a625321d7613bf6c7b6ba7e6c4c5e77e257d780db414799f62786d63" }, "downloads": -1, "filename": "django_post_request_task-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "603016de6024069c8f835f727e37aadf", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 7853, "upload_time": "2016-10-11T17:39:52", "url": "https://files.pythonhosted.org/packages/c7/c7/012678f7359cb3575f18f9fd9e66c5fa8c251e56465cc9bf1ea7634ad9a9/django_post_request_task-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06941a65e0b825a0a85e79e787eff07d", "sha256": "015b407b8bc81f13104a5607c2765cc2cafc628661ffcfa1f4563fdc9eba2ffb" }, "downloads": -1, "filename": "django-post-request-task-0.1.1.tar.gz", "has_sig": false, "md5_digest": "06941a65e0b825a0a85e79e787eff07d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6127, "upload_time": "2016-10-11T17:39:46", "url": "https://files.pythonhosted.org/packages/67/9e/0e9adad5ce9a552b93a83b0fd709f2fad91fb4d206a636727fe3d715d5d9/django-post-request-task-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "25f944938a0ef0fbcb44981f17e7ade5", "sha256": "b761beed705c18d6ee85642049d07ca9d7f936e3392c6d56a58c36a39e5e9803" }, "downloads": -1, "filename": "django_post_request_task-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "25f944938a0ef0fbcb44981f17e7ade5", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7871, "upload_time": "2017-11-07T12:29:54", "url": "https://files.pythonhosted.org/packages/82/23/5f44e07dba8b4ec8293de2f6f881a4ec024bf529e2c9b95bbd60d186ce6f/django_post_request_task-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "818dec81b7eaa9f46ee04277cb9b47e9", "sha256": "7afe4c7418db8592a7b56391cbfe56a86008bc1b4622dd923573b6981ba1562c" }, "downloads": -1, "filename": "django-post-request-task-0.2.0.tar.gz", "has_sig": false, "md5_digest": "818dec81b7eaa9f46ee04277cb9b47e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6131, "upload_time": "2017-11-07T12:29:27", "url": "https://files.pythonhosted.org/packages/fe/10/c06ec47af020b4ca3d8d340a5f93c50aaed5f27b6e2c15a203193be11ea3/django-post-request-task-0.2.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "99181ae165ceb51097f8c0757b31e55b", "sha256": "82d376ab7a1166b74a41a6099e7e1947fd8c4ec6706354511bb05800e3e2086d" }, "downloads": -1, "filename": "django_post_request_task-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "99181ae165ceb51097f8c0757b31e55b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6979, "upload_time": "2019-06-25T11:01:38", "url": "https://files.pythonhosted.org/packages/db/57/52af0299bce8894a1104f5bd8394cffcbd673cbc4d133f4c05dcd3535b3e/django_post_request_task-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "deb366f5e8df14d0a8df8be35a33d233", "sha256": "a8940209ca9cf5ce4824116a22d8de1739f418f2d3a7dab4243fd68cea9b623f" }, "downloads": -1, "filename": "django-post-request-task-0.4.0.tar.gz", "has_sig": false, "md5_digest": "deb366f5e8df14d0a8df8be35a33d233", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6114, "upload_time": "2019-06-25T11:01:40", "url": "https://files.pythonhosted.org/packages/0d/78/b9b7df83578a340ee7ad3ae4e1006ee0d9ae1eccda555cf7eeff21aa09b1/django-post-request-task-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "7c1929c27d2971ce1af2decaf6a4419b", "sha256": "9ae8f3c7255d00717a4699cd39377c42c47bcc2524306d2d4ecf80f6c6b1f6b1" }, "downloads": -1, "filename": "django_post_request_task-0.4.1-py2-none-any.whl", "has_sig": false, "md5_digest": "7c1929c27d2971ce1af2decaf6a4419b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7847, "upload_time": "2019-09-02T07:50:23", "url": "https://files.pythonhosted.org/packages/ce/2a/edd690e7a750959e146a999ea96486c184c696304738b0c0339d5e2f9342/django_post_request_task-0.4.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04713df5766ef286ee2b97a1bb515d90", "sha256": "19b4d22b02abe74ea48946aaf74d8d698e46a4911e2271059420238580420358" }, "downloads": -1, "filename": "django_post_request_task-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "04713df5766ef286ee2b97a1bb515d90", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7851, "upload_time": "2019-09-02T08:13:08", "url": "https://files.pythonhosted.org/packages/04/f7/ea992bc7cffd314bcc23c7bddcc4bc7bd31bf9751dd32e1ccaefa47ab8c5/django_post_request_task-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9f6c59b2413a99abbf8666395174b8d", "sha256": "c8be3e96d3a58616ec750f3a2d3add62eab8adf44c572c12de89130408917eac" }, "downloads": -1, "filename": "django_post_request_task-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d9f6c59b2413a99abbf8666395174b8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7848, "upload_time": "2019-09-02T08:13:09", "url": "https://files.pythonhosted.org/packages/59/65/43886c2b0073eb00ff044624252a3d66cf09734763117440160d66b764aa/django_post_request_task-0.4.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7c1929c27d2971ce1af2decaf6a4419b", "sha256": "9ae8f3c7255d00717a4699cd39377c42c47bcc2524306d2d4ecf80f6c6b1f6b1" }, "downloads": -1, "filename": "django_post_request_task-0.4.1-py2-none-any.whl", "has_sig": false, "md5_digest": "7c1929c27d2971ce1af2decaf6a4419b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7847, "upload_time": "2019-09-02T07:50:23", "url": "https://files.pythonhosted.org/packages/ce/2a/edd690e7a750959e146a999ea96486c184c696304738b0c0339d5e2f9342/django_post_request_task-0.4.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04713df5766ef286ee2b97a1bb515d90", "sha256": "19b4d22b02abe74ea48946aaf74d8d698e46a4911e2271059420238580420358" }, "downloads": -1, "filename": "django_post_request_task-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "04713df5766ef286ee2b97a1bb515d90", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7851, "upload_time": "2019-09-02T08:13:08", "url": "https://files.pythonhosted.org/packages/04/f7/ea992bc7cffd314bcc23c7bddcc4bc7bd31bf9751dd32e1ccaefa47ab8c5/django_post_request_task-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9f6c59b2413a99abbf8666395174b8d", "sha256": "c8be3e96d3a58616ec750f3a2d3add62eab8adf44c572c12de89130408917eac" }, "downloads": -1, "filename": "django_post_request_task-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d9f6c59b2413a99abbf8666395174b8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7848, "upload_time": "2019-09-02T08:13:09", "url": "https://files.pythonhosted.org/packages/59/65/43886c2b0073eb00ff044624252a3d66cf09734763117440160d66b764aa/django_post_request_task-0.4.1-py3-none-any.whl" } ] }