Skip to content

Instantly share code, notes, and snippets.

@naoyeye
Created December 5, 2012 10:02
Show Gist options
  • Save naoyeye/4214429 to your computer and use it in GitHub Desktop.
Save naoyeye/4214429 to your computer and use it in GitHub Desktop.
import web
import app.controllers
from config import view
def notfound():
return web.notfound(view.error())
urls = (
'/post/(\+?[1-9][0-9]*)', 'app.controllers.post.post_show', #正则匹配url 验证非零的正整数
)
app = web.application(urls, globals())
if __name__ == "__main__":
app.notfound = notfound
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment