def get_region_code(request):
 if ('X-AppEngine-City' in request.headers):
  return request.headers['X-AppEngine-Region']
 return None

def get_region_code ( request ) : if ( 'X-AppEngine-City' in request . headers ) : return request . headers [ 'X-AppEngine-Region' ] return None
city code based on iso 3166-1 .