backport url reverse security fix from 1.4.x
remove debug code
Merge pull request #1 from luyun-aa/luyun/backport_url_reverse_patch

backport url reverse security fix from 1.4.x