i have been writing and testing my new web application with werkzeug,
and have grown quite fond of it. everything more or less just works,
and the entire application is still tiny, not overstructured, and
fast. so, a big THANK YOU goes to the developers of werkzeug!
i still have a small problem with routing: with some routing setups,
as in the example below, the browser will complain that the page isn't
redirecting properly. the source of the trouble seems to be that
`defaults` dictionary in the second rule. granted it is not needed at
this point in this particular setup, but what i really want is to map
routes like `/flimsy`, `/flimsy/any-query`, and `/flimsy/any-query/any-
options`. when the `options` part is absent, it should be given a
default, but as soon as i add that argument in the second routing
rule, i get endless redirections. any ideas?
cheers & ~flow
def expose( rule, **Q ):
def decorate(f):
Q[ 'endpoint' ] = f.__name__
Q.setdefault( 'strict_slashes', False ) # causes all `/xy` and `/
xy/` to contain equal content
url_map.add( Rule( rule, **Q ) )
return f
return decorate
@expose( '/flimsy', defaults = { 'q': 'NIL', } )
@expose( '/flimsy/<q>', defaults = { } ) # adding
defaults causes redirection issue
# @expose( '/flimsy/<q>/<path:options>')
def flimsy( request, **Q ):
return _Json_Response({ 'flimsy': Q })
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---