簡體   English   中英

如何調試DJango測試服務器提供的錯誤500?

[英]How do I debug error 500's served up by the DJango test server?

我正在嘗試調試DJango Paypal IPN集成,但是我很掙扎。 Django dev服務器向控制台報告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

另一件事是嘗試在計算機上啟動一個簡單的SMTP服務器。

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

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

來源: Djangodocs測試電子郵件發送

鑒於您正在運行django的pre-alpha版本,我建議在django用戶列表https://groups.google.com/group/django-users上提出這個問題

看看django-sentry

它記錄500個錯誤(也支持常規日志記錄),使動態“橙色500頁”在事后可瀏覽。 當你永遠不會得到原始的錯誤頁面時,這是特別有用的,例如當你使用ajax或遠程apis時

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM