在我的Django项目中,我需要在我的视图中将一些数据发送/发布到第三方URL,并重定向到它提供的网页.例如,我可以简单地做一些事情
class TestView(TemplateView):
def get(self, request, *args, **kwargs):
data = {
'order_id': 88888,
'subject': 'haha',
'rn_check': 'F',
'app_pay': 'T',
}
url = 'http://some-third-party-api-url?order_id=88888&subject=haha&...'
return HttpResponseRedirect(url)
但是我想将这个第三方api用作包装的SDK,比如
class TestView(TemplateView):
def get(self, request, *args, **kwargs):
from sucre.alipay_sdk.base import Alipay
from sucre.alipay_sdk import alipay_config
from django.http import HttpResponse
alipay = Alipay(alipay_config)
data = {
'order_id': 88888,
'subject': 'haha',
'rn_check':