I am converting Html into pdf using xhtml2pdf using Django and this is my code
def render_to_pdf(template_src, context_dict={}): template = get_template(t