alexmorozov / templated-docs

Generate PDF, MS Word and Excel documents from templates in Django
MIT License
114 stars 57 forks source link

get_template_sources() takes 2 positional arguments but 3 were given #29

Open cypna opened 5 years ago

cypna commented 5 years ago

Description

Im trying to pass fill_template('dashboard/report/word/invoice.odt', context, output_format='pdf')

What I Did

def report_html_view(request,project_id):
    try :
        context = {'number':'93333333'}  # Just an example
        filename = fill_template('dashboard/report/word/invoice.odt', context, output_format='pdf')
        visible_filename = 'greeting.pdf'
    except Exception as e:
        print('Something Went Wrong.!'+ str(e))
    return FileResponse(filename, visible_filename)

Output / Error

get_template_sources() takes 2 positional arguments but 3 were given

gniccolini commented 5 years ago

Same here with django 2.2.4

cloarcaios commented 5 years ago

En la linea 74 del archivo templated_docs/init.py, quitale el segundo parametro None, la linea quedaría así:

for origin in loader.get_template_sources(template_name):

Saludos.

ghost commented 4 years ago

With django 3.0.3 it is still not useable, will there be any fixes or is this just dead?