code: def context(self):
          
          stats = status_codes_by_date_stats()
  
          attacks_data = [{
              'type': 'line',
              'zIndex': 9,
              'name': _('Attacks'),
              'data': [(v[0], v[1]['attacks'])
                       for v in stats]
          }]
  
          codes_data = [{
              'zIndex': 4,
              'name': '2xx',
              'data': [(v[0], v[1][200]) for v in stats]
          }, {
              'zIndex': 5,
              'name': '3xx',
              'data': [(v[0], v[1][300]) for v in stats]
          }, {
              'zIndex': 6,
              'name': '4xx',
              'data': [(v[0], v[1][400]) for v in stats]
          }, {
              'zIndex': 8,
              'name': '5xx',
              'data': [(v[0], v[1][500]) for v in stats]
          }]
  
          return {'generic_chart': json.dumps(status_codes_by_date_chart()),
                  'attacks_data': json.dumps(attacks_data),
                  'codes_data': json.dumps(codes_data)}
docs: Get the context.