3

私は製品を販売するプロジェクトを作成しており、django でペイパルを使用して支払いをしたいと考えています。しかし、私はこのエラーが発生しました:

'billing_tags' は有効なタグ ライブラリではありません: importError が発生しました loading loadingbilling.templatetags.billing_tags: Braintree という名前のモジュールはありません

settings.pyはすでに入れて'paypal.standard.ipn'INSTALLED_APPSますPAYPAL_RECEIVER_EMAIL

Pythonシェルにチェックすると..

>>> from billing import get_integration
>>> get_integration("pay_pal")
<billing.integrations.pay_pal_integration.PayPalIntegration object at 0x9d41b0c>

つまり、それは機能しています...

urls.pyの中に、私はこれを持っています:

from billing import get_integration
pay_pal = get_integration("pay_pal")
urlpatterns = patterns('',
    (r'^paypal-ipn-handler/', include(pay_pal.urls)),
)

私の views.py で:

from billing import get_integration
from paypal.standard.forms import PayPalPaymentsForm
def booking_save_page(request, id):
.....
form = BookTicketForm(request.GET)
if form.is_valid():
    inst = Ticket.objects.create(
               date_select = form.cleaned_data['date_select'],
               product_name = product.name,
               quantity = form.cleaned_data['quantity'],
               totalcost = form.cleaned_data['totalcost'],
               price = form.cleaned_data['price'],
               first_name = form.cleaned_data['first_name'],
               last_name = form.cleaned_data['last_name'],
               contact = form.cleaned_data['contact'],
               product = product,
               client = client,
               trans_code = code,
               email = form.cleaned_data['email'],
               memo = form.cleaned_data['memo'],
               status = 'Pending',
               created = now,
               )
    pay_pal = get_integration("pay_pal")
    pay_pal.add_fields({
           "business": "ccfiel@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})
    form = PayPalPaymentsForm(initial=pay_pal)
    context = {"form": form}
    return render_to_response("pay_pay.html", context)
 ......

私のテンプレートpay_pay.htmlにはこれしかありません:

<h1>Pay Here</h1>
{{ form.render }}

問題はビューでのレンダリングにあるpay_pay.htmlと思います...なぜこのエラーが発生したのですか:

'billing_tags' は有効なタグ ライブラリではありません: importError が発生しました loading loadingbilling.templatetags.billing_tags: Braintree という名前のモジュールはありません

誰かが私の状況について考えを持っていますか?

4

1 に答える 1

3

ターミナルに入力pip install braintreeして、サーバーをリロードします。

于 2012-01-11T07:51:13.073 に答える