![](/img/trans.png)
[英]What is wrong with this redirect? (Google App Engine - Python)
[英]what's wrong with my python code in google app engine? [send an email]
我想使用URL查詢var ['f'] ['t'] ['s'] ['c']發送電子郵件。 當我在Googl應用引擎中啟動代碼時,我看到了
錯誤:服務器錯誤
服務器遇到錯誤,無法完成您的請求。 如果問題仍然存在,請報告您的問題並提及此錯誤消息以及引起該問題的查詢。
我的代碼是
import cgi
from google.appengine.api import mail
form = cgi.FieldStorage()
sendfrom = form.getvalue("f")
reciver = form.getvalue("t")
title = form.getvalue("s")
content = form.getvalue("c")
print sendfrom
print reciver
print title
print content
mail.send_mail(
sender = sendfrom,
to = reciver,
subject = title,
body = content
)
我想知道我的代碼有什么問題嗎?
通過appengine.google.com登錄到您的管理控制台,單擊您的應用程序,然后單擊“日志”。 此頁面顯示所有請求的日志記錄,並且出於安全和可用性的原因,這是記錄異常的位置-不在返回給用戶的頁面上。 該頁面上的異常日志應該告訴您您在做什么錯。
另外,您實際上不應該使用CGI-很難正確使用(提示:您需要首先輸出標頭),並且您會浪費大量時間來重新設計輪子,這很多事情可以通過使用CGI來輕松完成。適當的框架。 改用WSGI框架, 像這樣 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.