def version(request): # Use the version.json file in the current dir. with suppress(IOError): with open(VERSION_FILE) as fd: return web.json_response(json.load(fd)) return web.HTTPNotFound()