def actueel(): response = mc.get(MEMCACHE_KEY) if not response: headers = {'User-Agent': 'weerapi -- https://github.com/erikr/weerapi'} data = requests.get(URL, headers=headers).text response = KNMIData().actueel(data) mc.set(MEMCACHE_KEY, response, time=MEMCACHE_EXPIRY) return Response(response=json.dumps(response, indent=4), status=200, mimetype="application/json")
def setUp(self): self.knmidata = KNMIData()