Skip to content Skip to sidebar Skip to footer

How To Export .csv With Django-tables2?

I'm trying to export a table in .csv with Django-Tables2, I've done the following so far. tables.py class ClientTable(ColumnShiftTable): class Meta: model = Client

Solution 1:

In template.html I added {% load django_tables2%}

I passed SingleTableMixin as the 'ClientsView' parameter.

In ClientTable I added export_formats = ['csv', 'xlsx']

This solved my problem.

Post a Comment for "How To Export .csv With Django-tables2?"