I have a html invoice file. Currently my django app is not serving it. I want to pass some variable to it and then download it as a HttpResponse
.
My invoice file folder structure is like:
--someFolder/invoice(folder)
|__ index.html
|__ style.css
|__ logo.png
I have a function in my models file like:
def createInvoice(self, po_number):
po = self.purchase_orders.find_one({'po_number':po_number})
total_po_qty = po['total_po_qty']
po_subtotal = po['po_subtotal']
tax_value = po['tax_value']
shipping_value = po['shipping_value']
total_po_value = po['total_po_value']
vendor_name = po['vendor_name']
tax_percent = po['tax_percent']
tax_type = po['tax_type']
expiry_date = po['expiry_date']
sku_list = po['sku_list']
How can i pass these variables to the html file? I can render the file as a view but i dont want to do that since it is bound to a download button.