用 VERSION: 2.5.0-dev 遇到的一些问题

2011-05-07 22:47:55 +08:00
 lin
最近 用 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

或许我中间某些环节操作失误?

求教!
5441 次点击
所在节点    Project Babel
7 条回复
EricZ
2011-05-10 00:12:32 +08:00
没有问题呀?我也遇过到这个自动跳转的问题。这个bug不仅再topic.py里面有。在整个package里查找“www.v2ex.com”,会发现还有别处也有相同的问题。
Livid
2011-05-10 00:48:22 +08:00
因为是在开发的进行过程中,所以目前代码中确实存在一些 hardcoded 的部分,在正式 release 的版本中是不会这样的。
chone
2011-05-10 03:07:20 +08:00
我记得发帖部分把topic.py里 #continue部分注释掉就行了
@Livid 是不是应该考虑开一个dev branche,master保持stable线
lin
2011-05-10 15:10:20 +08:00
抱歉,忘了说我已经解决了这些问题了。谢谢!

@chone ,并不是 @Livid 的问题。或许没必要这么麻烦,集中力量让正式版出来才是正道,要用于生产的朋友等正式版就好,用于测试和开发的朋友,可以再琢磨研究,实在不行再提出问题不迟。
chone
2011-05-10 16:22:43 +08:00
@lin 开分支也不会影响进度吧,这样也有利于这个项目的发展。目前这样的状态想参与都会觉得很困难,也会给不了解的人带来很多的困惑。
chone
2011-05-10 16:25:44 +08:00
另外我觉得v2ex本身应该也由一个独立的分支来维护,毕竟project babel和v2ex发型版本还是存在很多不同的
EricZ
2011-05-11 00:59:43 +08:00
同意@chone的说法。第一次装PB2的时候用的是Git版,确实有一个"-dev"的后缀,但是还是造成了一点疑惑。

@Livid现在还欢迎参与者么?如何参与?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/12690

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX