I\'m trying to implement a redirecting pattern, similar to what StackOverflow does:
@route(\'///\')
@route(\'//\')
de
Well, it looks like my original code actually worked. Flask-Classy was the issue here (and since this question has a bounty, I can't delete it).
I forgot that Flask-Classy renames routes, so instead of url_for('ClassName:profile')
, I'd have to select the outermost decorator's route:
url_for('ClassName:profile_1')
An alternative would be to explicitly specify an endpoint to the route:
@route('///', endpoint='ClassName:profile')