@jerith This is something I adapted from a blog post or something written by the Flask developer, never took a good look at it. Is it important to do this in this PR?