@register.filter<EOL>def obfuscate(value, juice=None):
if not settings.UNFRIENDLY_ENABLE_FILTER:<EOL><INDENT>return value<EOL><DEDENT>kwargs = {<EOL>'<STR_LIT:key>': encrypt(value,<EOL>settings.UNFRIENDLY_SECRET,<EOL>settings.UNFRIENDLY_IV,<EOL>checksum=settings.UNFRIENDLY_ENFORCE_CHECKSUM),<EOL>}<EOL>if juice:<EOL><INDENT>kwargs['<STR_LIT>'] = slugify(juice)<EOL><DEDENT>return reverse('<STR_LIT>', kwargs=kwargs)<EOL>
Template filter that obfuscates whatever text it is applied to. The text is
supposed to be a URL, but it will obfuscate anything.

Usage:
    Extremely unfriendly URL:
    {{ "/my-secret-path/"|obfuscate }}

    Include some SEO juice:
    {{ "/my-secret-path/"|obfuscate:"some SEO friendly text" }}