无效的块标记:'pay_pal',预期'endblock'或'endblock content'

时间:2012-01-11 08:19:10

标签: python django django-templates

有没有人对此有所了解,我该如何处理?

  

无效的块标记:'pay_pal',预期'endblock'或'endblock content'

在我的views.py中,我有这个

pay_pal = get_integration("pay_pal")
pay_pal.add_fields({
       "business": "test@gmail.com",
       "item_name": product.name,
       "invoice": inst.id,
       "notify_url": settings.BASE_DNS + "/paypal-ipn-handler/",
       "return_url": settings.BASE_DNS + str(client.id) + '/book/'+str(inst.id) +'/success/?booksaved=1',
       "cancel_return": settings.BASE_DNS + str(client.id) + '/?booksaved=0',
       "amount": inst.totalcost})
return render_to_response("pay_pay.html", {"obj": pay_pal},context_instance=RequestContext(request))

在我的模板pay_pay.html中,我有这个:

{% extends "main_base_bookingpage.html" %}
{% block bodyclass %}product-add{% endblock %}

{% block content %}
<h1>Pay here!</h1>
{% load billing_tags %} 
{% pay_pal obj %}
{% endblock %}

1 个答案:

答案 0 :(得分:8)

可能您必须将{% load billing_tags %}移至pay_pay.html的顶部。