Ticket #18220: 18220-2.diff
File 18220-2.diff, 3.3 KB (added by , 13 years ago) |
---|
-
django/conf/global_settings.py
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index a88ea40..4711baa 100644
a b SESSION_FILE_PATH = None # Directory to store ses 464 464 # CACHE # 465 465 ######### 466 466 467 # New format467 # The cache backends to use. 468 468 CACHES = { 469 'default': { 470 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 471 } 469 472 } 470 # The cache backend to use. See the docstring in django.core.cache for the471 # possible values.472 473 CACHE_MIDDLEWARE_KEY_PREFIX = '' 473 474 CACHE_MIDDLEWARE_SECONDS = 600 474 475 CACHE_MIDDLEWARE_ALIAS = 'default' -
django/core/cache/__init__.py
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index d8095d4..8f07f13 100644
a b def parse_backend_uri(backend_uri): 64 64 65 65 return scheme, host, params 66 66 67 if not settings.CACHES:68 legacy_backend = getattr(settings, 'CACHE_BACKEND', None)69 if legacy_backend:70 import warnings71 warnings.warn(72 "settings.CACHE_* is deprecated; use settings.CACHES instead.",73 DeprecationWarning74 )75 else:76 # The default cache setting is put here so that we77 # can differentiate between a user who has provided78 # an explicit CACHE_BACKEND of locmem://, and the79 # default value. When the deprecation cycle has completed,80 # the default can be restored to global_settings.py81 settings.CACHE_BACKEND = 'locmem://'82 83 # Mapping for new-style cache backend api84 backend_classes = {85 'memcached': 'memcached.CacheClass',86 'locmem': 'locmem.LocMemCache',87 'file': 'filebased.FileBasedCache',88 'db': 'db.DatabaseCache',89 'dummy': 'dummy.DummyCache',90 }91 engine, host, params = parse_backend_uri(settings.CACHE_BACKEND)92 if engine in backend_classes:93 engine = 'django.core.cache.backends.%s' % backend_classes[engine]94 else:95 engine = '%s.CacheClass' % engine96 defaults = {97 'BACKEND': engine,98 'LOCATION': host,99 }100 defaults.update(params)101 settings.CACHES[DEFAULT_CACHE_ALIAS] = defaults102 103 67 if DEFAULT_CACHE_ALIAS not in settings.CACHES: 104 68 raise ImproperlyConfigured("You must define a '%s' cache" % DEFAULT_CACHE_ALIAS) 105 69 -
docs/internals/deprecation.txt
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index e3a5e1a..3096e6a 100644
a b these changes. 186 186 library earlier than 2.1. An accelerated timeline was used as this was 187 187 a security related deprecation. 188 188 189 * The ``CACHE_BACKEND`` setting will be removed. The cache backend(s) should be 190 specified in the :setting:`CACHES` setting. 189 191 190 192 1.6 191 193 --- -
docs/ref/settings.txt
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 7b5c363..ede2d37 100644
a b ADMIN_MEDIA_PREFIX 2311 2311 integration. See the :doc:`Django 1.4 release notes</releases/1.4>` for 2312 2312 more information. 2313 2313 2314 .. setting:: CACHE_BACKEND2315 2316 CACHE_BACKEND2317 -------------2318 2319 .. deprecated:: 1.32320 This setting has been replaced by :setting:`BACKEND <CACHES-BACKEND>` in2321 :setting:`CACHES`.2322 2323 2314 .. setting:: IGNORABLE_404_ENDS 2324 2315 2325 2316 IGNORABLE_404_ENDS