Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Advanced deprecations in core.cache.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 576606a6f230bc50a82433eb60661737742c2a59 1 parent 24b7d90
@freakboy3742 freakboy3742 authored
View
2  django/core/cache/__init__.py
@@ -80,7 +80,7 @@ def parse_backend_uri(backend_uri):
import warnings
warnings.warn(
"settings.CACHE_* is deprecated; use settings.CACHES instead.",
- PendingDeprecationWarning
+ DeprecationWarning
)
else:
# The default cache setting is put here so that we
View
24 django/core/cache/backends/memcached.py
@@ -126,24 +126,18 @@ def delete_many(self, keys, version=None):
def clear(self):
self._cache.flush_all()
-# For backwards compatibility -- the default cache class tries a
-# cascading lookup of cmemcache, then memcache.
class CacheClass(BaseMemcachedCache):
def __init__(self, server, params):
+ warnings.warn(
+ "memcached.CacheClass has been split into memcached.MemcachedCache and memcached.PyLibMCCache. Please update your cache backend setting.",
+ PendingDeprecationWarning
+ )
try:
- import cmemcache as memcache
- import warnings
- warnings.warn(
- "Support for the 'cmemcache' library has been deprecated. Please use python-memcached or pyblimc instead.",
- DeprecationWarning
- )
- except ImportError:
- try:
- import memcache
- except:
- raise InvalidCacheBackendError(
- "Memcached cache backend requires either the 'memcache' or 'cmemcache' library"
- )
+ import memcache
+ except:
+ raise InvalidCacheBackendError(
+ "Memcached cache backend requires either the 'memcache' or 'cmemcache' library"
+ )
super(CacheClass, self).__init__(server, params,
library=memcache,
value_not_found_exception=ValueError)
View
6 docs/internals/deprecation.txt
@@ -186,6 +186,12 @@ their deprecation, as per the :ref:`Django deprecation policy
synonym for ``django.views.decorators.csrf.csrf_exempt``, which should
be used to replace it.
+ * The :class:`~django.core.cache.backends.memcached.CacheClass` backend
+ was split into two in Django 1.3 in order to introduce support for
+ PyLibMC. The historical :class:`~django.core.cache.backends.memcached.CacheClass`
+ is now an alias for :class:`~django.core.cache.backends.memcached.MemcachedCache`.
+ In Django 1.6, the historical alias will be removed.
+
* 2.0
* ``django.views.defaults.shortcut()``. This function has been moved
to ``django.contrib.contenttypes.views.shortcut()`` as part of the
Please sign in to comment.
Something went wrong with that request. Please try again.