{ "info": { "author": "Peter Bengtsson", "author_email": "mail@peterbe.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "django-fancy-cache\n==================\n\n(c) Peter Bengtsson, mail@peterbe.com, 2013\n\nAbout django-fancy-cache\n------------------------\n\nA Django `cache_page` decorator on steroids.\n\nUnlike the stock `django.views.decorators.cache.change_page` this\ndecorator makes it possible to set a `key_prefixer` that is a\ncallable. This callable is passed the request and if it returns `None`\nthe page is not cached.\n\nAlso, you can set another callable called `post_process_response`\n(which is passed the response and the request) which can do some\nadditional changes to the response before it's set in cache.\n\nLastly, you can set `post_process_response_always=True` so that the\n`post_process_response` callable is always called, even when the\nresponse is coming from the cache.\n\n\nHow to use it\n-------------\n\nIn your Django views:\n\n from fancy_cache import cache_page\n\n\t@cache_page(60 * 60)\n\tdef myview(request):\n\t return render(request, 'page1.html')\n\n\tdef prefixer(request):\n\t if request.method != 'GET':\n\t return None\n\t if request.GET.get('no-cache'):\n\t return None\n\t return 'myprefix'\n\n\t@cache_page(60 * 60, key_prefixer=prefixer)\n\tdef myotherview(request):\n\t return render(request, 'page2.html')\n\n\tdef post_processor(response, request):\n\t response.content += ''\n\t return response\n\n\t@cache_page(60 * 60,\n\t key_prefixer=prefixer,\n\t\t post_process_response=post_processor)\n\tdef yetanotherotherview(request):\n\t return render(request, 'page3.html')\n\n\nRunning the test suite\n----------------------\n\nThe simplest way is to simply run:\n\n $ pip install -r requirements.txt\n $ fab test\n\nOr to run it without `fab` you can simply run:\n\n $ export PYTHONPATH=`pwd`\n\t$ export DJANGO_SETTINGS_MODULE=fancy_cache.tests.settings\n\t$ django-admin.py test", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/peterbe/django-fancy-cache", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "fancy_cache", "package_url": "https://pypi.org/project/fancy_cache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fancy_cache/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/peterbe/django-fancy-cache" }, "release_url": "https://pypi.org/project/fancy_cache/0.1/", "requires_dist": null, "requires_python": null, "summary": "clears the junk out of your CSS", "version": "0.1" }, "last_serial": 791886, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ac21c95d9f649e88ce54b0fde6a69702", "sha256": "2e8a66cc0151f9b4c15160c119ec2c34e3db7b704962a466fa19576314f39819" }, "downloads": -1, "filename": "fancy_cache-0.1.tar.gz", "has_sig": false, "md5_digest": "ac21c95d9f649e88ce54b0fde6a69702", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6765, "upload_time": "2013-01-22T02:12:36", "url": "https://files.pythonhosted.org/packages/1f/13/bd996acc8c6b034f15f0affbfb47c638083111b244ff9fefa730c097ca24/fancy_cache-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ac21c95d9f649e88ce54b0fde6a69702", "sha256": "2e8a66cc0151f9b4c15160c119ec2c34e3db7b704962a466fa19576314f39819" }, "downloads": -1, "filename": "fancy_cache-0.1.tar.gz", "has_sig": false, "md5_digest": "ac21c95d9f649e88ce54b0fde6a69702", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6765, "upload_time": "2013-01-22T02:12:36", "url": "https://files.pythonhosted.org/packages/1f/13/bd996acc8c6b034f15f0affbfb47c638083111b244ff9fefa730c097ca24/fancy_cache-0.1.tar.gz" } ] }