def elastic(request): INDEX = settings.ES_INDEXES['default'] es = search.get_es() indexes = set(settings.ES_INDEXES.values()) es_mappings = { 'addons': get_addons_mappings(), 'addons_stats': get_stats_mappings(), } ctx = { 'index': INDEX, 'nodes': es.nodes.stats(), 'health': es.cluster.health(), 'state': es.cluster.state(), 'mappings': [(index, es_mappings.get(index, {})) for index in indexes], } return render(request, 'zadmin/elastic.html', ctx)