1

我正在尝试调试我的DJango Paypal IPN 集成,但我很挣扎。Django 开发服务器向控制台报告 500 错误(但没有其他详细信息),IPN 测试工具报告 500 错误但没有其他详细信息。

我尝试禁用该DEBUG模式以尝试让它向我发送电子邮件,但尽管将 EMAIL_HOST 设置为合适的,但我没有看到任何电子邮件。我尝试并验证电子邮件系统是否正在调用send_mail ..但成功了,我仍然没有看到有关内部服务器错误的电子邮件。

我会错过什么?

编辑

我正在从 PyCharm 运行开发服务器,控制台输出如下所示:

runnerw.exe C:\Python26\python.exe manage.py runserver 192.168.1.4:80
Validating models...

0 errors found
Django version 1.4 pre-alpha, using settings 'settings'
Development server is running at http://192.168.1.4:80/
Quit the server with CTRL-BREAK.
Verifying...
...response: VERIFIED
IpnEndPoint.on_process
Valid: {u'last_name': u'Smith', u'txn_id': u'491116223', u'receiver_email': u'seller@paypalsandbox.com', u'payment_status': u'Completed', u'tax': u'2.02', u'payer_status': u'unverified', u'residence_country': u'US', u'invoice': u'abc1234', u'address_state': u'CA', u'item_name1': u'something', u'txn_type': u'cart', u'item_number1': u'AK-1234', u'quantity1': u'1', u'payment_date': u'14:03:49 Nov 16, 2011 PST', u'first_name': u'John', u'mc_shipping': u'3.02', u'address_street': u'123, any street', u'charset': u'windows-1252', u'custom': u'xyz123', u'notify_version': u'2.4', u'address_name': u'John Smith', u'address_zip': u'95131', u'test_ipn': u'1', u'receiver_id': u'TESTSELLERID1', u'payer_id': u'TESTBUYERID01', u'mc_handling1': u'1.67', u'verify_sign': u'A8SIYWSxkrwNPfuNewSuxsIAatvMAi2mxYjlYvaiWh3Z4BuIQojK3KBO', u'mc_handling': u'2.06', u'mc_gross_1': u'9.34', u'address_country_code': u'US', u'address_city': u'San Jose', u'address_status': u'confirmed', u'address_country': u'United States', u'mc_fee': u'0.44', u'mc_currency': u'USD', u'payer_email': u'buyer@paypalsandbox.com', u'payment_type': u'instant', u'mc_shipping1': u'1.02'}
Logging Transaction..
[16/Nov/2011 22:20:49] "POST /IPN/ HTTP/1.0" 500 104946
4

3 回答 3

2

要尝试的另一件事是在您的机器上启动一个简单的 SMTP 服务器。

python -m smtpd -n -c DebuggingServer localhost:1025

这将在您的控制台上输出所有电子邮件标题和正文。确保 localhost 和端口 1025 对应于您在 settings.py 中的内容,分别在 EMAIL_HOST 和 EMAIL_PORT 中。

来源: Djangodocs 测试电子邮件发送

于 2011-11-16T22:56:42.500 回答
1

鉴于您正在运行 django 的 pre-alpha 版本,我建议您在 django 用户列表https://groups.google.com/group/django-users上提出这个问题

于 2011-11-16T22:34:17.803 回答
0

看看django-sentry

它记录 500 个错误(也支持常规记录),使动态“橙色 500 页”在事后可浏览。当您从未获得原始错误页面时,这尤其有用,例如在使用 ajax 或远程 api 时,如您的情况

于 2011-11-16T22:10:36.767 回答