如何在新的Django应用程序中集成视图

2024-09-22 14:31:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我有django paypal视图.py地址:

    from paypal.standard.forms import PayPalPaymentsForm

    def view_that_asks_for_money(request):

     paypal_dict = {
    "business": settings.PAYPAL_RECEIVER_EMAIL,
    "amount": "10000000.00",
    "item_name": "name of the item",
    "invoice": "unique-invoice-id",
    "notify_url": "https://www.example.com" + reverse('paypal-ipn'),
    "return_url": "https://www.example.com/your-return-location/",
    "cancel_return": "https://www.example.com/your-cancel-location/",

}

# Create the instance.
form = PayPalPaymentsForm(initial=paypal_dict)
context = {"form": form}
return render_to_response("payment.html", context)

我必须包括在我的基本应用程序的例子,使所有的功能将工作和付款.html渲染


Tags: thenamehttpsformcomurlyourreturn