Miyazaki
Miyazaki

Reputation: 1069

tornado, How to map URL and handler with a regular expression way

I want to map "/aaa.jpg" and "/bbb.jpg".... with the same Handler

I write the code as(r"/*.jpg", ImageHandler"), it that correct ? It doesn't work for me..

Upvotes: 0

Views: 360

Answers (1)

Ben Darnell
Ben Darnell

Reputation: 22134

r"/*.jpg" is a file glob pattern, not a regular expression. The equivalent regular expression would be r"/.*\.jpg".

Upvotes: 1

Related Questions