V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lin
V2EX  ›  Project Babel

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

  •  
  •   lin · 2011-05-07 22:47:55 +08:00 · 5431 次点击
    这是一个创建于 4765 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近 用 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

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

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

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

    @Livid现在还欢迎参与者么?如何参与?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2177 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 16:13 · PVG 00:13 · LAX 09:13 · JFK 12:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.