@receiver(post_save, sender=Release)
def purge_fastly_download_pages(sender, instance, **kwargs):
 if kwargs.get('raw', False):
  return
 if instance.is_published:
  purge_url('/downloads/')
  purge_url('/downloads/latest/python2/')
  purge_url('/downloads/latest/python3/')
  purge_url('/downloads/mac-osx/')
  purge_url('/downloads/source/')
  purge_url('/downloads/windows/')
  if (instance.get_version() is not None):
   purge_url('/ftp/python/{}/'.format(instance.get_version()))
  purge_url(instance.get_absolute_url())

@ receiver ( post_save , sender = Release ) def purge_fastly_download_pages ( sender , instance , ** kwargs ) : if kwargs . get ( 'raw' , False ) : return if instance . is_published : purge_url ( '/downloads/' ) purge_url ( '/downloads/latest/python2/' ) purge_url ( '/downloads/latest/python3/' ) purge_url ( '/downloads/mac-osx/' ) purge_url ( '/downloads/source/' ) purge_url ( '/downloads/windows/' ) if ( instance . get_version ( ) is not None ) : purge_url ( '/ftp/python/{}/' . format ( instance . get_version ( ) ) ) purge_url ( instance . get_absolute_url ( ) )
purge fastly caches so new downloads show up more quickly .