V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
DAOCLOUD
推荐学习书目
Python Cookbook
Using Google App Engine
推荐下载
Latest Google App Engine SDK
其他兼容技术
AppScale
CupTools
V2EX  ›  Google App Engine

URL Shortener

  •  
  •   CupTools · 2010-08-29 06:31:31 +08:00 · 16792 次点击
    这是一个创建于 5003 天前的主题,其中的信息可能已经有所发展或是发生改变。
    好吧,我承认我蛋疼了,把wmshorty部署在GAE上面,绑定一个很长的域名:

    http://gae.3p.gd/

    好吧,我承认我是Python新手,我看不明白很多东西:

    #Used for normal request.
    application = webapp.WSGIApplication([('/', UrlHandler)],
    debug=True)
    #Enable url rewrite /{url or code}.
    application = webapp.WSGIApplication([('/(.*)', UrlHandler)],
    debug=True)

    wsgiref.handlers.CGIHandler().run(application)
    2 条回复    1970-01-01 08:00:00 +08:00
    imom0
        1
    imom0  
       2010-08-30 00:52:54 +08:00 via Android
    大小写敏感的。默认提供的webapp就是这样写嘛。
    GordianZ
        2
    GordianZ  
    MOD
       2010-08-30 01:06:48 +08:00
    @CupTools
    这段写的是dispatcher, 用户访问根路径"/"就显示首页,用户访问"/xxx"就提供跳转
    http://code.google.com/appengine/docs/python/tools/webapp/wsgiapplicationclass.html
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5295 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:44 · PVG 17:44 · LAX 02:44 · JFK 05:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.