{ "info": { "author": "Daniel Quinn", "author_email": "code@danielquinn.org", "bugtrack_url": null, "classifiers": [ "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "django-tigger\n#############\n\nBounce users out of your view by raising an exception\n\nIntroduction\n============\n\nYou're probably used to this sort of workflow:\n\n.. code:: python\n\n from django.http import Http404\n from django.views.generic import TemplateView\n\n class MyView(TemplateView):\n def get_context(self, **kwargs):\n # do some stuff\n raise Http404\n\n...but wouldn't it be nice if rather than just bombing out with a 404, you\ncould bounce the user out to a redirect and attach a friendly message? That's\nwhat django-tigger does!\n\n.. code:: python\n\n from django.core.urlresolvers import reverse\n from django.views.generic import TemplateView\n from tigger.exceptions import Bounce\n\n class MyView(TemplateView):\n def get_context(self, **kwargs):\n # do some stuff\n raise Bounce(\n reverse(\"some-url\"),\n message=\"The wonderful thing about tiggers...\",\n level=\"SUCCESS\"\n )\n\nThe above code will bounce the user to whatever ``some-url`` resolves to and\ndump a message on the screen using the Django messaging framework.\n\n\nInstallation\n============\n\n1. Use pip: ``pip install django-tigger``.\n2. Add ``django_tigger.middleware.BouncingMiddleware`` to your ``MIDDLEWARE``\n list in your Django settings. Note that you don't need to add this to\n ``INSTALLED_APPS`` as this package doesn't have any models, migrations, or\n anything that would require that.\n\n\nUse\n====\n\nBasically anywhere you want to just bail out of your current process and\ninstead redirect the user, call ``Bounce()`` and pass in a few arguments:\n\n* ``url``: The only required argument, this is where you're bouncing your user\n to.\n* ``message``: If supplied, this will attach a message to the user's session\n using the Django messaging framework\n* ``level``: The level of the message. Must be one of ``DEBUG``, ``INFO``,\n ``SUCCESS``, ``WARNING``, ``ERROR``. The default is ``INFO``.\n\n\nSupport\n=======\n\nI've used this in Python 3 and Django 1.11, but I see no reason why it wouldn't\nwork in Python 2.7 and Django 1.10. Older than that though, and you'll have\ntrouble. Newer than that, and you should be fine.\n\nThis isn't particularly complex code ;-)\n\n\nColophon\n========\n\n::\n\n The wonderful thing about tiggers\n Is tiggers are wonderful things\n Their tops are made out of rubber\n Their bottoms are made out of springs\n They're bouncy, trouncy, flouncy, pouncy fun, fun, fun, fun, fun\n But the most wonderful thing about tiggers is I'm the only one\n I'm the only one.\n -- Winnie the Pooh and Tigger Too!, 1974\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/danielquinn/django-tigger", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/danielquinn/django-tigger", "keywords": "", "license": "AGPLv3", "maintainer": "", "maintainer_email": "", "name": "django-tigger", "package_url": "https://pypi.org/project/django-tigger/", "platform": "", "project_url": "https://pypi.org/project/django-tigger/", "project_urls": { "Download": "https://github.com/danielquinn/django-tigger", "Homepage": "https://github.com/danielquinn/django-tigger" }, "release_url": "https://pypi.org/project/django-tigger/1.1.0/", "requires_dist": [ "Django (>=1.11)" ], "requires_python": "", "summary": "Bounce users out of your view by raising an exception", "version": "1.1.0" }, "last_serial": 3603085, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "a53b6203b8f3888d849f978d1299d6c2", "sha256": "bc30ff230299841b9801b2dc3d264deb8941da3e273e1956d143f08be3b34f54" }, "downloads": -1, "filename": "django_tigger-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a53b6203b8f3888d849f978d1299d6c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5413, "upload_time": "2018-02-12T18:10:10", "url": "https://files.pythonhosted.org/packages/08/3d/2c00907a558e8dddc832d818550f0e313db909bc67d080e7ee8afdbb686e/django_tigger-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "207510178fbe6c28b902a3f724353704", "sha256": "ac2fd5770bda65ecb6004f3ca45bd7cc614f15d1ea60697a4628ab15792ca819" }, "downloads": -1, "filename": "django-tigger-1.0.1.tar.gz", "has_sig": false, "md5_digest": "207510178fbe6c28b902a3f724353704", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16189, "upload_time": "2018-02-12T18:10:12", "url": "https://files.pythonhosted.org/packages/b4/6e/cd1dfebda560f86665a60f87616d09600cd8d801e806324336d345e4f205/django-tigger-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "44c6d5650b1521053e70b97229d6f0f6", "sha256": "b39d5fc3c21e0754320f1b88f1455fd43b5eb06fd2a0ba1f44a4009e24c78b47" }, "downloads": -1, "filename": "django_tigger-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "44c6d5650b1521053e70b97229d6f0f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5680, "upload_time": "2018-02-12T18:13:22", "url": "https://files.pythonhosted.org/packages/79/21/7c442fc61b1678a0e8db23b8d9c684d86d913de4fc8d704026a8792055d9/django_tigger-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aca69030a03ad7707476653687fa3a59", "sha256": "632f8164646c311d1722b00bd58e7dd7f92465c398e45df95b81d51f3755567a" }, "downloads": -1, "filename": "django-tigger-1.0.2.tar.gz", "has_sig": false, "md5_digest": "aca69030a03ad7707476653687fa3a59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16509, "upload_time": "2018-02-12T18:13:23", "url": "https://files.pythonhosted.org/packages/45/65/1c25c737c912749efaca7c5c89ce7907b08c0213af5f41592711c426ab6b/django-tigger-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "52d9a8f239076f3c57851c2f4010f27a", "sha256": "5bec7d21e9081ff0fc200bdd99b340b84d20b4df401ff5a2990a762542b9eaae" }, "downloads": -1, "filename": "django_tigger-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "52d9a8f239076f3c57851c2f4010f27a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5725, "upload_time": "2018-02-21T19:27:10", "url": "https://files.pythonhosted.org/packages/c7/df/0faf797f42be5f6fe057c85997b9ea6584e90fab658c447c0bbceea81d3d/django_tigger-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "331de0b20815df26db61faab538d7b81", "sha256": "6aaab4cde698efdbf992fdb14e8e4944a1b45202b1d4d73ba096619499c58f10" }, "downloads": -1, "filename": "django-tigger-1.1.0.tar.gz", "has_sig": false, "md5_digest": "331de0b20815df26db61faab538d7b81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3388, "upload_time": "2018-02-21T19:27:12", "url": "https://files.pythonhosted.org/packages/12/f9/023b9b46be28c6ba9b0dfd644d678940648e8c3ebaf63bc931d1ee9a77be/django-tigger-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52d9a8f239076f3c57851c2f4010f27a", "sha256": "5bec7d21e9081ff0fc200bdd99b340b84d20b4df401ff5a2990a762542b9eaae" }, "downloads": -1, "filename": "django_tigger-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "52d9a8f239076f3c57851c2f4010f27a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5725, "upload_time": "2018-02-21T19:27:10", "url": "https://files.pythonhosted.org/packages/c7/df/0faf797f42be5f6fe057c85997b9ea6584e90fab658c447c0bbceea81d3d/django_tigger-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "331de0b20815df26db61faab538d7b81", "sha256": "6aaab4cde698efdbf992fdb14e8e4944a1b45202b1d4d73ba096619499c58f10" }, "downloads": -1, "filename": "django-tigger-1.1.0.tar.gz", "has_sig": false, "md5_digest": "331de0b20815df26db61faab538d7b81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3388, "upload_time": "2018-02-21T19:27:12", "url": "https://files.pythonhosted.org/packages/12/f9/023b9b46be28c6ba9b0dfd644d678940648e8c3ebaf63bc931d1ee9a77be/django-tigger-1.1.0.tar.gz" } ] }