I have a solution that works in development (VScode, Django v5.1, Python 3.12.5) returning a pdf file created in a buffer using io.BytesIO then return a page response using FileResponse. The following is part of the code that works in the development environment:
buffer = io.BytesIO()...