From aa239e3e5405933af6a29dac3cf587b59a099927 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Tue, 5 Aug 2008 17:15:33 +0000 Subject: gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/cache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'django/utils/cache.py') diff --git a/django/utils/cache.py b/django/utils/cache.py index 603199cc7e..78063c6b11 100644 --- a/django/utils/cache.py +++ b/django/utils/cache.py @@ -17,7 +17,6 @@ An example: i18n middleware would need to distinguish caches by the "Accept-language" header. """ -import md5 import re import time try: @@ -29,6 +28,7 @@ from django.conf import settings from django.core.cache import cache from django.utils.encoding import smart_str, iri_to_uri from django.utils.http import http_date +from django.utils.hashcompat import md5_constructor cc_delim_re = re.compile(r'\s*,\s*') @@ -104,7 +104,7 @@ def patch_response_headers(response, cache_timeout=None): if cache_timeout < 0: cache_timeout = 0 # Can't have max-age negative if not response.has_header('ETag'): - response['ETag'] = '"%s"' % md5.new(response.content).hexdigest() + response['ETag'] = '"%s"' % md5_constructor(response.content).hexdigest() if not response.has_header('Last-Modified'): response['Last-Modified'] = http_date() if not response.has_header('Expires'): @@ -138,7 +138,7 @@ def patch_vary_headers(response, newheaders): def _generate_cache_key(request, headerlist, key_prefix): """Returns a cache key from the headers given in the header list.""" - ctx = md5.new() + ctx = md5_constructor() for header in headerlist: value = request.META.get(header, None) if value is not None: -- cgit v1.2.1