Ah, now I get it, some of the code comes from the Flask project.

Then it indeed needs to be 3 clause BSD (what both Flask and Werkzeug use):
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.