具有多个变量的烧瓶渲染模板

时间:2019-12-26 09:35:31

标签: python flask jinja2

在主模板中,我以html形式填充数据,然后尝试使用从主模板接收到的多个数据来呈现模板。

def pay_post(self):
        data = EuroResource.pay_data(self)
        # return render_template('pay_eur.html', **data)
        return render_template('pay_eur.html', payer_currency=data['payer_currency'], shop_amount=data['shop_amount'], shop_currency=data["shop_currency"], shop_id=data["shop_id"], shop_order_id=data["shop_order_id"], sign=data["sign"])

但是不幸的是,数据没有在我的新模板中呈现,也没有从主页重新分配到pay_eur.html。 我不明白为什么我的模板无法呈现。

这是我模板的一部分

<form name="Pay" method="post" action=" https://pay.piastrix.com/ru/pay">
           <input name="payer_currency" value={{ payer_currency }}/>
           <input name="shop_amount" value={{ shop_amount }}/>
           <input type="submit" value="Confirm"/>
       </form>
``

0 个答案:

没有答案