2012-01-11 23 views
2

沒有人對此有一個想法,我該如何處理它?無效的塊標記:'pay_pal',預計'endblock'或'endblock內容'

無效的塊標籤: 'pay_pal',預計 '端基封閉' 或 '端塊內容'

在我 views.py

,我有這個

pay_pal = get_integration("pay_pal") 
pay_pal.add_fields({ 
     "business": "[email protected]", 
     "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 %} 
+0

你使用的是什麼貝寶庫? – 2012-01-11 09:36:22

回答

8

可能,你必須移動{% load billing_tags %}pay_pay.html的頂部。

+0

感謝Alexander的回覆,我嘗試將它移到pay_pay.html的頂部,但它不會工作,它也有同樣的問題...... – gadss 2012-01-11 08:28:43

+1

然後,顯然,在billing_tags中沒有名爲pay_pal的塊templatetags圖書館。 – 2012-01-11 12:00:53

+0

@AlexanderArtemenko:s/block/tag/ – 2012-01-11 21:34:39

相關問題