{ "info": { "author": "Ahmed Hisham Ismail", "author_email": "ahm3d.hisham@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP" ], "description": "# django-json-404-middleware\nDJango middleware that returns 404s as JSON instead of default html response\n\n\nWhen using Django for a restuful API, for example with DRF, it makes sense to return errors as JSON, which is what happens with 400s, 403s, etc. since they are generated by DRF themselves i.e `serializer.is_valid(raise_exception=True)` This however is not the case with 404s.\nThis middleware remedies this problem by intercepting 404 responses and turning them into JSON responses.\n\nPlease note that middleware [changed in django 1.10](https://docs.djangoproject.com/en/1.10/topics/http/middleware/) and thus this pacakge requires django version >= 1.10.\n\n\n```python\nMIDDLEWARE = [\n\t# Should come after any django middleware such as CommonMiddleware\n\t'django_json_404_middleware.JSON404Middleware',\n]\n```\n\n# Installation\n`pip install django-json-404-middleware`\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ah450/django-json-404-middleware", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-json-404-middleware", "package_url": "https://pypi.org/project/django-json-404-middleware/", "platform": "", "project_url": "https://pypi.org/project/django-json-404-middleware/", "project_urls": { "Homepage": "https://github.com/ah450/django-json-404-middleware" }, "release_url": "https://pypi.org/project/django-json-404-middleware/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Django middleware that returns 404s as JSON instead of html", "version": "0.0.1" }, "last_serial": 2508245, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "acee93783d1a162448db18ccefaba4bf", "sha256": "8e133a7814a70a89188101e21fcd30be79160dcdc8571cdc707729d69c557c72" }, "downloads": -1, "filename": "django_json_404_middleware-0.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "acee93783d1a162448db18ccefaba4bf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4008, "upload_time": "2016-12-09T06:24:00", "url": "https://files.pythonhosted.org/packages/e5/39/4a0c23ea89a4ccea614318ac5c16c74e725cb4d8b57970c0df07963d010f/django_json_404_middleware-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "96b4870d06ba6eff6e36cf95bd8aa76f", "sha256": "cd38450284e198a05df890296fa87b0fade9ff2dba2380bb4f528b83b750964c" }, "downloads": -1, "filename": "django-json-404-middleware-0.0.1.tar.gz", "has_sig": true, "md5_digest": "96b4870d06ba6eff6e36cf95bd8aa76f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2240, "upload_time": "2016-12-09T06:24:02", "url": "https://files.pythonhosted.org/packages/7b/26/579fc2306bc5899456243e2157f1e593a63300aa0829206a58319d1ee9c9/django-json-404-middleware-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "acee93783d1a162448db18ccefaba4bf", "sha256": "8e133a7814a70a89188101e21fcd30be79160dcdc8571cdc707729d69c557c72" }, "downloads": -1, "filename": "django_json_404_middleware-0.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "acee93783d1a162448db18ccefaba4bf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4008, "upload_time": "2016-12-09T06:24:00", "url": "https://files.pythonhosted.org/packages/e5/39/4a0c23ea89a4ccea614318ac5c16c74e725cb4d8b57970c0df07963d010f/django_json_404_middleware-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "96b4870d06ba6eff6e36cf95bd8aa76f", "sha256": "cd38450284e198a05df890296fa87b0fade9ff2dba2380bb4f528b83b750964c" }, "downloads": -1, "filename": "django-json-404-middleware-0.0.1.tar.gz", "has_sig": true, "md5_digest": "96b4870d06ba6eff6e36cf95bd8aa76f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2240, "upload_time": "2016-12-09T06:24:02", "url": "https://files.pythonhosted.org/packages/7b/26/579fc2306bc5899456243e2157f1e593a63300aa0829206a58319d1ee9c9/django-json-404-middleware-0.0.1.tar.gz" } ] }