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.
Share
Post a Comment
for "How To Export .csv With Django-tables2?"
Post a Comment for "How To Export .csv With Django-tables2?"