def purge_url(path):
 if settings.DEBUG:
  return
 api_key = getattr(settings, 'FASTLY_API_KEY', None)
 if api_key:
  response = requests.request('PURGE', 'https://www.python.org{}'.format(path), headers={'Fastly-Key': api_key})
  return response
 return None

def purge_url ( path ) : if settings . DEBUG : return api_key = getattr ( settings , 'FASTLY_API_KEY' , None ) if api_key : response = requests . request ( 'PURGE' , 'https://www.python.org{}' . format ( path ) , headers = { 'Fastly-Key' : api_key } ) return response return None
purge a fastly .