You could have avoided copy-pasta in favour of passing in the structure in the context.  I.e.,
  data = [{'title': 'Users', 'list': [...]}, {'title': 'Roles'}, ...]
On the other hand, I suppose you intend to change the meta-data associated with each of these subtables, so maybe leaving it copy-pasta is ok.