Skip to content

Instantly share code, notes, and snippets.

View ozscosta's full-sized avatar
🌴
Developmeting

Ozeias Costa ozscosta

🌴
Developmeting
  • Codefuture
  • Palmas, BRA
View GitHub Profile
@ozscosta
ozscosta / fileresponseutils.py
Created August 13, 2024 00:55 — forked from HeinrichWizardKreuser/fileresponseutils.py
Django FIleResponse helpers
from django.http import FileResponse
from io import BufferedReader, BytesIO
def file_response_from_str(content: str, filename: str) -> FileResponse:
""" Serves a file response from the given string
Args:
content: str