{ "info": { "author": "Maks Skorokhod", "author_email": "samael500@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.10", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "=============================\r\nDjango Web Exceptions\r\n=============================\r\n\r\n.. image:: https://badge.fury.io/py/django-web-exceptions.svg\r\n :target: https://badge.fury.io/py/django-web-exceptions\r\n\r\n.. image:: https://travis-ci.org/samael500/web-exceptions.svg?branch=master\r\n :target: https://travis-ci.org/samael500/web-exceptions\r\n\r\n.. image:: https://codecov.io/gh/samael500/web-exceptions/branch/master/graph/badge.svg\r\n :target: https://codecov.io/gh/samael500/web-exceptions\r\n\r\n.. image:: https://readthedocs.org/projects/web-exceptions/badge/?version=latest\r\n :target: http://web-exceptions.readthedocs.io/en/latest/readme.html\r\n :alt: Documentation Status\r\n\r\nThrowing web exceptions like in AioHTTP\r\n\r\nWhat and why?\r\n-------------\r\n\r\nIn AioHTTP_ you can raise any response as exception (this is very cool).\r\nBut Django can raise only 3+1 web exceptions.\r\n\r\n- `400` `SuspiciousOperation `_\r\n- `403` `PermissionDenied `_\r\n- `404` `Http404 `_\r\n- `500` Any other non catched exception\r\n\r\nThis package allow you to raise as exception any of HTTP response.\r\n\r\n.. And configure any custome `handlerXXX` for that.\r\n\r\nDocumentation\r\n-------------\r\n\r\nThe full documentation is at https://web-exceptions.readthedocs.io.\r\n\r\nQuickstart\r\n----------\r\n\r\nInstall Django Web Exceptions::\r\n\r\n pip install django-web-exceptions\r\n\r\nAdd it to your `MIDDLEWARE`:\r\n\r\n.. code-block:: python\r\n\r\n # settings.py\r\n MIDDLEWARE = (\r\n # ...\r\n 'web_exceptions.middleware.WebExceptionsMiddleware',\r\n # ...\r\n )\r\n\r\nFeatures\r\n--------\r\n\r\nImport exceptions and raise anywhere\r\n\r\n.. code-block:: python\r\n\r\n # views.py\r\n from web_exceptions import exceptions\r\n\r\n # ...\r\n\r\n def index(request):\r\n \"\"\" Simple view raise redirectexception \"\"\"\r\n raise exceptions.HTTPMovedPermanently('/foo')\r\n\r\n\r\nAlso you can customize any kind of exception status code as custom handler,\r\ndefined in `urls.py` like `django error handlers `_ .\r\n\r\n.. code-block:: python\r\n\r\n # urls.py\r\n from myapp import views\r\n\r\n handler300 = \r\n handler400 = \r\n handler = \r\n\r\nFor more example see `example proj `_\r\n\r\n\r\nRunning Tests\r\n-------------\r\n\r\nDoes the code actually work?\r\n\r\n::\r\n\r\n source /bin/activate\r\n (myenv) $ pip install tox\r\n (myenv) $ tox\r\n\r\nCredits\r\n-------\r\n\r\nTools used in rendering this package:\r\n\r\n* Cookiecutter_\r\n* `cookiecutter-djangopackage`_\r\n\r\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\r\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\r\n.. _AioHTTP: https://github.com/aio-libs/aiohttp", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/samael500/web-exceptions", "keywords": "web-exceptions,django,web,exceptions,http,response", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-web-exceptions", "package_url": "https://pypi.org/project/django-web-exceptions/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-web-exceptions/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/samael500/web-exceptions" }, "release_url": "https://pypi.org/project/django-web-exceptions/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "Throwing web exceptions like in AioHTTP", "version": "0.1.4" }, "last_serial": 2904815, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f17eec0fd09e18f62f4a835604f1be49", "sha256": "df6f236ac41449d1e4ec380b229d87d32d8bfd1d9dc60abb531d71c8a98a89df" }, "downloads": -1, "filename": "django_web_exceptions-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f17eec0fd09e18f62f4a835604f1be49", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6998, "upload_time": "2017-05-13T18:50:19", "url": "https://files.pythonhosted.org/packages/f7/d9/86389639efc18a4b713f51b1d4056757efa773b2b91da28b0e4a05122145/django_web_exceptions-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "938862c44d5e9b08a8ec5cd141004b92", "sha256": "cabfbf117a76325fae12ebe9a12c811ef96de6a5a28242f019fbb193ef60a853" }, "downloads": -1, "filename": "django-web-exceptions-0.1.0.tar.gz", "has_sig": false, "md5_digest": "938862c44d5e9b08a8ec5cd141004b92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7281, "upload_time": "2017-05-13T18:50:16", "url": "https://files.pythonhosted.org/packages/e2/49/3ea50aed80342a1d34d3c37256c78bc32d9bcef0d4bd7658c716334c15d1/django-web-exceptions-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "fea4a8713d2f12780782bb61168f40d0", "sha256": "6f66b639f782c223df09e35b16a3681518425fe8d368570e972b6cc42b052453" }, "downloads": -1, "filename": "django_web_exceptions-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fea4a8713d2f12780782bb61168f40d0", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7069, "upload_time": "2017-05-13T20:38:04", "url": "https://files.pythonhosted.org/packages/05/c9/2a803fde41aec7a8591b5a9627717820393981f7ba1a468b7cf85d761168/django_web_exceptions-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c80a426f871bf90429389cdfa21f534", "sha256": "70f37ffb96955411ab13e71dc5262f20984592d34b17908cfe81cd0077973cec" }, "downloads": -1, "filename": "django-web-exceptions-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8c80a426f871bf90429389cdfa21f534", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7321, "upload_time": "2017-05-13T20:38:02", "url": "https://files.pythonhosted.org/packages/a9/89/6680bfcfaead86330f0ac2d7590a04ac9b1b505cf83687ac87e22b820970/django-web-exceptions-0.1.1.tar.gz" } ], "0.1.2": [], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e90039eabc22103105e50abf4959a49e", "sha256": "06fb66c033238efbeac41f5fad16e4576613345898aec487a31356397e0102eb" }, "downloads": -1, "filename": "django_web_exceptions-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e90039eabc22103105e50abf4959a49e", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7267, "upload_time": "2017-05-15T10:37:32", "url": "https://files.pythonhosted.org/packages/d9/d6/3802e2e5034e0baf718a1810ae143649341eae3b31406a04bb22f9b8d450/django_web_exceptions-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e254c04c79fd16bf3bb26acfcd6d70c", "sha256": "6d10e4226f703c3c0792d7c061488b98c34716a6e200b406ab7c7273c16157dd" }, "downloads": -1, "filename": "django-web-exceptions-0.1.3.tar.gz", "has_sig": false, "md5_digest": "9e254c04c79fd16bf3bb26acfcd6d70c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7490, "upload_time": "2017-05-15T10:37:29", "url": "https://files.pythonhosted.org/packages/e7/9b/8002b0a4c00fcc650be0784195d7feed872ccf4b06beb1d2471ebc04ef4a/django-web-exceptions-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "19f4812bc964efa63e5e4bc8a917993a", "sha256": "5370c7bb18cfaa337e1c030630236df3f0a23c343c46495fcf31dd4f07e473dc" }, "downloads": -1, "filename": "django_web_exceptions-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "19f4812bc964efa63e5e4bc8a917993a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7270, "upload_time": "2017-05-28T16:12:02", "url": "https://files.pythonhosted.org/packages/16/e0/81706143b600b5bcbe4bc591dbc9bded0eecc636b33be267ba73a36d6eed/django_web_exceptions-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a9837218bbde24ca33e2f394c9205ff", "sha256": "ee0b547090c0b5998cbe5f1d722ce86045c20340a445723bc761d38647053c3e" }, "downloads": -1, "filename": "django-web-exceptions-0.1.4.tar.gz", "has_sig": false, "md5_digest": "7a9837218bbde24ca33e2f394c9205ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7698, "upload_time": "2017-05-28T16:11:56", "url": "https://files.pythonhosted.org/packages/4e/83/0b5ae39f88581f82d912dd22a590730ebe459d5c05992e6a3ee46bcbc6f7/django-web-exceptions-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19f4812bc964efa63e5e4bc8a917993a", "sha256": "5370c7bb18cfaa337e1c030630236df3f0a23c343c46495fcf31dd4f07e473dc" }, "downloads": -1, "filename": "django_web_exceptions-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "19f4812bc964efa63e5e4bc8a917993a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7270, "upload_time": "2017-05-28T16:12:02", "url": "https://files.pythonhosted.org/packages/16/e0/81706143b600b5bcbe4bc591dbc9bded0eecc636b33be267ba73a36d6eed/django_web_exceptions-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a9837218bbde24ca33e2f394c9205ff", "sha256": "ee0b547090c0b5998cbe5f1d722ce86045c20340a445723bc761d38647053c3e" }, "downloads": -1, "filename": "django-web-exceptions-0.1.4.tar.gz", "has_sig": false, "md5_digest": "7a9837218bbde24ca33e2f394c9205ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7698, "upload_time": "2017-05-28T16:11:56", "url": "https://files.pythonhosted.org/packages/4e/83/0b5ae39f88581f82d912dd22a590730ebe459d5c05992e6a3ee46bcbc6f7/django-web-exceptions-0.1.4.tar.gz" } ] }