我的网站上有一个指向我的域名的应用程序。app spot应用程序正在运行一个非常简单的python脚本,如下所示:
import cgi,webapp2
class ProblemRedirect(webapp2.RequestHandler):
def post(self):
print(cgi.escape(self.request.get('problem_text')))
print(cgi.escape(self.request.get('student_name')))
print(cgi.escape(self.request.get('student_email')))
application = webapp2.WSGIApplication([
('/', ProblemRedirect),
], debug=True)
以下是我的表单的HTML:
^{pr2}$此表单位于另一个web服务器上,但由appspot脚本处理。但是,每当我提交表格时,都会出现错误:
XMLHttpRequest cannot load http://www.summit-tech-help.appspot.com/. Origin null is not allowed by Access-Control-Allow-Origin.
我做错什么了吗?另外,我在OSX上部署了googleappengine启动器中的应用程序。当我点击启动程序上的“运行”时,它就运行了本地主机:8080,那么当它工作时我能看到“打印”吗?谢谢!在
~地毯泡沫
您需要将此添加到处理程序:
将星形字符(接受每个主机)替换为要接受的源。见this link
相关问题 更多 >
编程相关推荐