2011-11-16 31 views
1

我試圖調試我的DJango Paypal IPN integration,但我很掙扎。 Django dev服務器向控制檯報告500錯誤(但沒有其他詳細信息),並且IPN測試工具報告500錯誤但沒有其他詳細信息。如何調試由DJango測試服務器提供的錯誤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'[email protected]', 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'[email protected]', 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 
+0

你可以發佈您的控制檯的內容(包括用於調用服務器的命令行)? –

回答

0

看看django-sentry

它記錄500錯誤(也支持定期記錄),使動態的「橙色500頁」可以在事後瀏覽。當你從未得到原始的錯誤頁面時,這是特別有用的,例如使用AJAX或遠程API,如你的情況下,當

+0

哨兵不適用於測試服務器 –

+1

我只運行1.8,但它有一個'sentry_testing'設置,它在調試模式下工作。有沒有被刪除? – second

+0

你可能是對的。我只是不知道這是一種可能性。 –

1

給正在運行的Django的阿爾法之前的版本,我會電子書籍提出這個問題,Django的用戶列表https://groups.google.com/group/django-users

+0

斑點斑點;我以爲我正在使用穩定的版本! –

+0

這裏沒有回答我的問題,但你釘了我打開的另一個。請張貼這個問題作爲這個問題的答案,我會接受它作爲最終的答案.. ...因爲在1.3.1穩定後退步了! –

+0

還有哪些問題? –

2

另一件事,試圖上推出簡單的SMTP服務器在您的機器上。

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

這將在您的控制檯上輸出所有電子郵件標題和正文。 請確保localhost和端口1025分別在EMAIL_HOST和EMAIL_PORT中對應settings.py中的內容。

來源: Djangodocs Testing email sending