{ "info": { "author": "MyOptique Group", "author_email": "tech@myoptiquegroup.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# cachecontrol-django\n\nA cache provider for [CacheControl](https://cachecontrol.readthedocs.io/) using Django's caching mechanism.\n\n[![PyPI](https://img.shields.io/pypi/v/cachecontrol-django.svg)](https://pypi.org/project/cachecontrol-django/) ![](https://img.shields.io/pypi/pyversions/cachecontrol-django.svg) [![Build Status](https://img.shields.io/travis/com/glassesdirect/cachecontrol-django.svg)](https://travis-ci.com/glassesdirect/cachecontrol-django) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n# Installation\n\n```\npip install cachecontrol-django\n```\n\n# Usage\n\n```python\nimport requests\nfrom cachecontrol import CacheControl\nfrom cachecontrol_django import DjangoCache\n\nsession = CacheControl(requests.session(), cache=DjangoCache())\nsession.get(\"https://www.glassesdirect.co.uk/\")\n```\n\n## Working Around Key Length Errors\n\nIf you see errors about key length (such as \"MemcachedKeyLengthError: Key length is > 250\"), you can ask DjangoCache to hash the keys it uses by specifying a `key_hash_algorithm`:\n\n```python\nlong_url = 'https://www.glassesdirect.co.uk/?q=' + ('x' * 250)\nsession = CacheControl(\n requests.session(),\n cache=DjangoCache(key_hash_algorithm='sha512')\n)\nsession.get(long_url)\n```\n\nNote that when hashing these keys, there is a very small chance of a hash collision causing a request for one URL to return the content of another.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/glassesdirect/cachecontrol-django", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "cachecontrol-django", "package_url": "https://pypi.org/project/cachecontrol-django/", "platform": "", "project_url": "https://pypi.org/project/cachecontrol-django/", "project_urls": { "Homepage": "https://github.com/glassesdirect/cachecontrol-django" }, "release_url": "https://pypi.org/project/cachecontrol-django/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A cache provider for CacheControl using Django's caching mechanism.", "version": "1.0.0" }, "last_serial": 4986900, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a35b0822440bea6228aa5537d5870390", "sha256": "83ed784f09518de41022b2f1e71fdbfe12d498a041669fa1159c92e5b989476e" }, "downloads": -1, "filename": "cachecontrol-django-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a35b0822440bea6228aa5537d5870390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1967, "upload_time": "2019-02-15T14:35:40", "url": "https://files.pythonhosted.org/packages/8c/0d/2160703af69f8352d685a1c665eaf186fc5e2b27a7823be295a338939887/cachecontrol-django-1.0.0.tar.gz" } ], "1.0.dev0": [ { "comment_text": "", "digests": { "md5": "6603268a014ef4565de42e05a4619051", "sha256": "2b75b5e729c0b68839ea61826d6b9b15e714504c8cca2fb3faa0c0accb21a023" }, "downloads": -1, "filename": "cachecontrol-django-1.0.dev0.tar.gz", "has_sig": false, "md5_digest": "6603268a014ef4565de42e05a4619051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1972, "upload_time": "2019-02-15T14:16:27", "url": "https://files.pythonhosted.org/packages/bd/fe/895c078d15666de30a36c398ee25913ff787f467bea0aebcb35184605776/cachecontrol-django-1.0.dev0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a35b0822440bea6228aa5537d5870390", "sha256": "83ed784f09518de41022b2f1e71fdbfe12d498a041669fa1159c92e5b989476e" }, "downloads": -1, "filename": "cachecontrol-django-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a35b0822440bea6228aa5537d5870390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1967, "upload_time": "2019-02-15T14:35:40", "url": "https://files.pythonhosted.org/packages/8c/0d/2160703af69f8352d685a1c665eaf186fc5e2b27a7823be295a338939887/cachecontrol-django-1.0.0.tar.gz" } ] }