Created
March 27, 2017 21:22
-
-
Save MandarGogate/6c043b52f1055dae3ac51ea551b26fa7 to your computer and use it in GitHub Desktop.
Django Export CSV (pip install django-queryset-csv)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from djqscsv import render_to_csv_response | |
def csv_view(request): | |
#queryset | |
qs = Foo.objects.filter(bar=True).values('id', 'bar') | |
return render_to_csv_response(qs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment