CS/python
[django] 장고 dataframe을 CSV로 응답하기 (CSV to Django Response)
judy@
2023. 1. 2. 15:32
다음과 같이 응답할 수 있음.
from django.http import HttpResponse
...
response = HttpResponse(content_type='text/csv')
df.to_csv(path_or_buff=response)
...
참고: https://stackoverflow.com/questions/54729411/pandas-csv-to-django-response
반응형