最近 用 Babel V2 2.5.0-dev 搭建了一个网站
http://www.35zhi.com/
首先遇到的问题是发帖失败,点“创建”后会跳转到www.v2ex.com
然后我试图在 topic.py 上作以下改动:
can_continue = True
if ('Host' in self.request.headers):
if (self.request.headers['Host'] not in ['www.35zhi.com', 'shengwuzhi.appspot.com', '35zhi.com', 'www.v2ex.com', 'v2ex.appspot.com', 'fast.v2ex.com', 'beta.v2ex.com', 'localhost:10000']):
can_continue = False
else:
can_continue = False
if ('User-Agent' not in self.request.headers):
can_continue = False
if ('Cookie' not in self.request.headers):
can_continue = False
if ('Referer' in self.request.headers):
has_v2ex = False
if ('http://localhost:10000' in self.request.headers['Referer']):
has_v2ex = True
if ('http://www.v2ex.com' in self.request.headers['Referer']):
has_v2ex = True
if ('http://v2ex.appspot.com' in self.request.headers['Referer']):
has_v2ex = True
if ('https://www.v2ex.com' in self.request.headers['Referer']):
has_v2ex = True
if ('https://v2ex.appspot.com' in self.request.headers['Referer']):
has_v2ex = True
if ('http://www.35zhi.com' in self.request.headers['Referer']):
has_v2ex = True
if ('http://shengwuzhi.appspot.com' in self.request.headers['Referer']):
has_v2ex = True
if ('https://www.35zhi.com' in self.request.headers['Referer']):
has_v2ex = True
if ('https://shengwuzhi.appspot.com' in self.request.headers['Referer']):
不过与此同时,我Deploy的时候遇到以下错误:
GMAutoUpdate: token fetch failed with error '请求超时。' [NSURLErrorDomain -1001]
于是我开VPN再Deploy结果成功了。
然后,在开新帖的时候,遇到一个 500 Sever Error:
http://www.35zhi.com/new/qna
或许我中间某些环节操作失误?
求教!