This is pretty easy to do. Note:
from django.core.files.base import ContentFile
The get_pdf_contents function should not be too complicated to write - basically, execute any function that you already use and chop it off before it turns the results into an HttpResponse object. If you need help, send the code that you already have.
source share