old_contents: from django.utils.functional import Promise
  from django.utils.encoding import force_unicode
  try:
      from simplejson import JSONEncoder
  except ImportError:
      from django.utils.simplejson import JSONEncoder
  
  class LazyEncoder(JSONEncoder):
      def default(self, obj):
          if isinstance(obj, Promise):
              return force_unicode(obj)
          return obj
  
new_contents: from django.utils.functional import Promise
  from django.utils.encoding import force_unicode
  try:
      from json import JSONEncoder
  except ImportError
      try:
          from simplejson import JSONEncoder
      except ImportError:
          from django.utils.simplejson import JSONEncoder
  
  class LazyEncoder(JSONEncoder):
      def default(self, obj):
          if isinstance(obj, Promise):
              return force_unicode(obj)
          return obj
  
subject: use the json package from the standard library if available