class MainPage(webapp.RequestHandler):

    def get(self, url=None):
        self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Happy New Year ' + str(url))
application = webapp.WSGIApplication([('/myapp/(?P<url>\\d{4})/$', MainPage
    )], debug=True)

def main():
    run_wsgi_app(application)
if __name__ == '__main__':
    pass
Динамические пути веб-приложения Python