I do not understand the error. He complains about endif while he is.
{% if pdf_enable %} {% download_url request.get_full_path "Download as Excel" %} {% endif %}
Did I miss something?
You need to download a custom template tag containing the download_url tag.
download_url
For example, if the download_url tag was in a module named download_tags , you should add the following to your template.
download_tags
{% load download_tags %}