def clear_static_cache(path):
 fully_qualified_path = os.path.join(django.conf.settings.WEB_ROOT, path)
 try:
  new_temp_path = tempfile.mkdtemp(dir=(django.conf.settings.WEB_ROOT + '/'))
 except OSError as e:
  if (e.errno == 28):
   shutil.rmtree(fully_qualified_path)
   return
 try:
  os.rename(fully_qualified_path, os.path.join(new_temp_path, 'old'))
 except OSError as e:
  if (e.errno == 2):
   pass
  else:
   raise
 shutil.rmtree(new_temp_path)

def clear_static_cache ( path ) : fully_qualified_path = os . path . join ( django . conf . settings . WEB_ROOT , path ) try : new_temp_path = tempfile . mkdtemp ( dir = ( django . conf . settings . WEB_ROOT + '/' ) ) except OSError as e : if ( e . errno == 28 ) : shutil . rmtree ( fully_qualified_path ) return try : os . rename ( fully_qualified_path , os . path . join ( new_temp_path , 'old' ) ) except OSError as e : if ( e . errno == 2 ) : pass else : raise shutil . rmtree ( new_temp_path )
atomically destroy the static file cache for a certain path .