diff --git a/piccolo_admin/example.py b/piccolo_admin/example.py index 5794ed26..a4022f6d 100644 --- a/piccolo_admin/example.py +++ b/piccolo_admin/example.py @@ -463,10 +463,12 @@ async def download_movies( output_file = io.StringIO(None) - csv.DictWriter( + writer = csv.DictWriter( f=output_file, fieldnames=["name", "release_date"], - ).writerows(movies) + ) + writer.writeheader() + writer.writerows(movies) return FileResponse( contents=output_file,