views:

192

answers:

2
application = webapp.WSGIApplication(
                                 [('/', DefaultPage),
          ('/ClearDataPage', ClearDataPage),
          ('/DeleteTweets', DeleteTweets),
          ('/DeleteLinks', DeleteLinks),
          ('/awesome', Awesome),
          ('/RunScriptPage', RunScriptPage)],
                                 debug=True)

In this scenario, how do I make any variations of "Awesome" or for that matter any url case insensitive?

such that Awesome will always be directed to localhost:8080/awesome ...?

+1  A: 

For such somewhat advanced dispatching needs, don't use the extremely lightweight webapp framework -- use any of the richer ones, such as web.py, that App Engine also supports; there, you can dispatch based on regular expressions, not just strings, so you can in particular use a case-insensitive regular expression pattern.

For example, '(?i)awesome' is the pattern for a regular expression that matches 'awesome' in a case-insensitive manner, as you desire.

Alex Martelli
Hold it right there! Webapp also supports dispatching on regular expressions! The regex you suggest for web.py will work perfectly on webapp.
Nick Johnson
+3  A: 

You may use regular expressions in this case. Wikipedia: Regular Expressions

Some app engine specific examples can be found in the app engine docs.

Jason Rikard