I am new in Django I try to develop a POS system where a user clicks on a button and a PDF will print I can generate PDF but I cannot print that PDF
Here is my code where I was trying to print the PDF file
import os
def printPDf(request, id):
context = AuthUser.objects.filter(id=id)
pdf = render_to_pdf('invoice.html', {'context': context})
response = HttpResponse(pdf, content_type='application/pdf')
os.system('lp -d HPLaserJ {0}'.format(response.strip()))