V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
DAOCLOUD
推荐学习书目
Python Cookbook
Using Google App Engine
推荐下载
Latest Google App Engine SDK
其他兼容技术
AppScale
CupTools

URL Shortener

  •  
  •   CupTools · Aug 29, 2010 · 17512 views
    This topic created in 5733 days ago, the information mentioned may be changed or developed.
    好吧,我承认我蛋疼了,把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 replies    1970-01-01 08:00:00 +08:00
    imom0
        1
    imom0  
       Aug 30, 2010 via Android
    大小写敏感的。默认提供的webapp就是这样写嘛。
    GordianZ
        2
    GordianZ  
       Aug 30, 2010
    @CupTools
    这段写的是dispatcher, 用户访问根路径"/"就显示首页,用户访问"/xxx"就提供跳转
    http://code.google.com/appengine/docs/python/tools/webapp/wsgiapplicationclass.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2982 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 07:00 · PVG 15:00 · LAX 00:00 · JFK 03:00
    ♥ Do have faith in what you're doing.