def count_view(request, key): try: db_key = db.Key(key) if db_key.kind() == 'Recipe': shard_key = SHARD_RECIPE_KEY % key else: shard_key = None if shard_key: Counter.incr(shard_key) except: # Don't care that much if something got wrong logging.exception('Error in count view') pass response = Response('GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00!\xf9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;', mimetype='image/gif') response.expires = datetime.datetime(2009, 1, 1) response.cache_control.must_revalidate = True return response