summaryrefslogtreecommitdiff
path: root/django/views/decorators/cache.py
AgeCommit message (Collapse)Author
2026-01-31Refs #34118 -- Removed asgiref coroutine detection shims.Jacob Walls
As Python 3.12 is now the floor, we can drop the shims and use the `inspect` module.
2023-04-25Refs #31949 -- Made @never_cache and @cache_control() decorators to work ↵Ben Lomax
with async functions. Thanks Carlton Gibson and Mariusz Felisiak for reviews.
2022-05-25Renamed wrapped functions to wrapper.Aymeric Augustin
All these functions are wrapping another function. They're the wrapper, while the function they're wrapping is the wrapped.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-12-16Fixed #33350 -- Reallowed using cache decorators with duck-typed HttpRequest.Mariusz Felisiak
Regression in 3fd82a62415e748002435e7bad06b5017507777c. Thanks Terence Honles for the report.
2021-02-24Refs #32468 -- Added error message on invalid usage of cache decorators.Haki Benita
2020-01-16Fixed #30765 -- Made cache_page decorator take precedence over max-age ↵Flavio Curella
Cache-Control directive.
2017-03-03Refs #27656 -- Updated django.views docstring verbs according to PEP 257.Anton Samarchyan
2017-02-01Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis
2017-01-21Refs #23919 -- Removed django.utils.decorators.available_attrs() usage.Tim Graham
It's only needed to workaround a bug on Python 2.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
2014-01-26Moved RequestSite and get_current_site.Aymeric Augustin
Following the app-loading refactor, these objects must live outside of django.contrib.sites.models because they must be available without importing the django.contrib.sites.models module when django.contrib.sites isn't installed. Refs #21680. Thanks Carl and Loic for reporting this issue.
2012-12-29Removed legacy ways of calling cache_page.Aymeric Augustin
2012-09-28Made more extensive use of get_current_siteClaude Paroz
Refs #15089
2012-05-03Fixed #18042 -- Advanced deprecation warnings.Aymeric Augustin
Thanks Ramiro for the patch.
2012-02-09Fixed #17643 -- Set a better stack level for the cache_page decorator ↵Jannis Leidel
deprecation warnings. Thanks, zsiciarz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-08Deprecated legacy ways of calling cache_pageLuke Plant
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-01Replaced old-style with new-style decorator syntax.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28Removed a bunch more Python 2.4 workarounds now that we don't support that ↵Adrian Holovaty
version. Refs #15702 -- thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21Fixed #11675 -- Added support for the PyLibMC cache library. In order to ↵Russell Keith-Magee
support this, and clean up some other 1.3 caching additions, this patch also includes some changes to the way caches are defined. This means you can now have multiple caches, in the same way you have multiple databases. A huge thanks to Jacob Burch for the work on the PyLibMC backend, and to Jannis for his work on the cache definition changes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04Fixed #14737 -- Moved the docstring comment for the cache_page decorator so ↵Russell Keith-Magee
it gets picked up as a docstring. Thanks to adamv for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-21Fixed #12019 - backwards compatibility issues with cache_page decorator.Luke Plant
Thanks to rokclimb15 for the report, and j4mie/rokclimb15 for the patches. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04Fixed #12164 -- Removed the Python 2.3 compatibility imports and ↵Russell Keith-Magee
workarounds. Thanks to timo and claudep for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-12Fixed #13093 -- Updated some decorators and the decorator_from_middleware ↵Russell Keith-Magee
function to allow callable classes to be decorated. Thanks to Brian Neal for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12762 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-09Fixed #12804 - regression with decorating admin views.Luke Plant
This is a BACKWARDS INCOMPATIBLE change, because it removes the flawed 'auto_adapt_to_methods' decorator, and replaces it with 'method_decorator' which must be applied manually when necessary, as described in the 1.2 release notes. For users of 1.1 and 1.0, this affects the decorators: * login_required * permission_required * user_passes_test For those following trunk, this also affects: * csrf_protect * anything created with decorator_from_middleware If a decorator does not depend on the signature of the function it is supposed to decorate (for example if it only does post-processing of the result), it will not be affected. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-28Added 'key_prefix' keyword argument to cache_page()Luke Plant
This was available before r11586, but undocumented. It has now been re-added with documentation and explicit support, as it seems like a useful feature and people were using it before. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-26Corrected regressions introduced in r11586 and r11593Luke Plant
I read the order of arguments in the docs incorrectly, doh! git-svn-id: http://code.djangoproject.com/svn/django/trunk@11594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-23Improved error messages when people use cache_page in undocumented and now ↵Luke Plant
unsupported ways. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-21Fixed #6371 - several decorators don't work with bound methods.Luke Plant
This involved changing the way the internal function decorator_from_middleware works slightly, breaking some code that relied on the old behaviour. As a result, it is much simpler, but cache_page has been made slightly more complex to cope with the change. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-25Fixed #5701 -- Fixed decorators to take the name, attributes, and docstring ↵Gary Wilson Jr
of the function they decorate by adding a modified version of the `functools.wraps` function from Python 2.5. `wraps` has been altered to work with Django's `curry` function and with Python 2.3, which doesn't allow assignment of a function's `__name__` attribute. This fixes severaly annoyances, such as the online documentation for template filters served by the admin app. This change is backwards incompatible if, for some reason, you were relying on the name of a Django decorator instead of the function it decorates. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-21Second half of little cleanup tweaks suggested by pyflakes.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty
backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-29Fixed #612 - added cache control headers (thanks, hugo)Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1020 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-09Fixed #580 -- Added mega support for generating Vary headers, including some ↵Adrian Holovaty
view decorators, and changed the CacheMiddleware to account for the Vary header. Also added GZipMiddleware and ConditionalGetMiddleware, which are no longer handled by CacheMiddleware itself. Also updated the cache.txt and middleware.txt docs. Thanks to Hugo and Sune for the excellent patches git-svn-id: http://code.djangoproject.com/svn/django/trunk@810 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-06Fixed #333 and #440 -- Split DEFAULT_MIME_TYPE setting into ↵Adrian Holovaty
DEFAULT_CONTENT_TYPE and DEFAULT_CHARSET. Thanks, Maniac. git-svn-id: http://code.djangoproject.com/svn/django/trunk@786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-18Moved django.views.decorators.cache.compress_string into django.utils.textAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-13Imported Django from private SVN repository (created from r. 8825)Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3 bcc190cf-cafb-0310-a4f2-bffc1f526a37