如何调试由DJango测试服务器提供的错误500? [英] How do I debug error 500's served up by the DJango test server?

查看:1883
本文介绍了如何调试由DJango测试服务器提供的错误500?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图调试我的 DJango Paypal IPN整合,但我正在努力。 Django开发者服务器向控制台报告500错误(但没有其他详细信息),IPN测试工具报告一个500错误,但没有其他详细信息。

I'm trying to debug my DJango Paypal IPN integration but I'm struggling. The Django dev server reports a 500 error to the console (but no other details) and the IPN test tool reports a 500 error but no other details.

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

I've tried disabling the DEBUG mode to try and get it to send me emails but despite setting up the EMAIL_HOST to something suitable, I'm not seeing any emails. I tried and verifying that the email system is working with a call to send_mail ..but that succeeds and I still see no emails regarding internal server errors.

我可能缺少什么?

编辑

我从PyCharm运行dev服务器,控制台输出如下所示:

I'm running the dev server from PyCharm and the console output looks like this:

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


推荐答案

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

Another thing to try is to launch a simple SMTP server on your machine.

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

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

Which will output on your console all emails headers and body. Make sure localhost and the port 1025 correpond to what you have in your settings.py, respectively in EMAIL_HOST and EMAIL_PORT.

资料来源:
< a href =https://docs.djangoproject.com/en/dev/topics/email/#testing-email-sending =nofollowtitle =Djangodocs测试电子邮件发送> Djangodocs测试邮件发送

这篇关于如何调试由DJango测试服务器提供的错误500?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆