Python中文
首页
教程
问答
标签
搜索
登录
注册
未定义全局名称“reverse”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在使用<code>django-paypal</code>库在我的网站上使用贝宝支付。</p> <p>在<a href="https://django-paypal.readthedocs.org/en/stable/standard/ipn.html" rel="noreferrer">example</a>之后,我设置了<code>paypal_dict</code>并添加了表单。</p> <pre><code>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/", } </code></pre> <p>但是,我得到了错误<code>global name 'reverse' is not defined</code>我使用的是Python 2.7.9,发生了什么?</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p><code>reverse</code>不是python中的内置函数。据推测,它是某个web框架中用于执行反向路由(从名称获取url路径)的函数。<code>notify_url</code>必须是Paypal将向其发送通知的应用程序中的url。</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Python闭包能否存储和更改外部标量?
4 回答
python闭包行为怪异
8 回答
python闭包问题源代码编译器
5 回答
Python问gam
10 回答
Python问答游戏逻辑E
4 回答
Python问答程序。你能帮我找出哪里出了问题吗?谢谢
8 回答
Python问答程序问题与分数
4 回答
Python问题
5 回答
Python问题 | 在https://www.testdome.com开发的代码测试分数有bug吗
3 回答
Python问题,上载文件的名称和缩略图
6 回答
python问题,将img的相对url连接到绝对url
7 回答
Python问题,机械化机器人
4 回答
Python问题,用不同的模板发送大量电子邮件?
4 回答
Python问题,类型错误:“float对象不能解释为integer”。无法在“for”循环中返回函数的值
9 回答
Python问题:“overflowerr:Python int太大,无法转换为C long”
7 回答
Python问题:“空数据帧的绑定方法NDFrame.head”
8 回答
Python问题:AttributeError:'_io.TextIOWrapper'对象没有属性'split'
10 回答
Python问题:AttributeError:'dict'对象没有'upper'属性
1 回答
Python问题:CS圆7C循环,正方形普查
9 回答
Python问题:ODE系统的参数估计,例如系数是函数
9 回答