@staticmethod<EOL><INDENT>def csrf_generator(secret):<DEDENT>
<EOL>hashed = hashlib.md5(uuid.uuid4().bytes + six.b(secret)).hexdigest()<EOL>span = <NUM_LIT:5><EOL>shift = random.randint(<NUM_LIT:0>, span)<EOL>return hashed[shift:shift - span - <NUM_LIT:1>]<EOL>
Generates CSRF token.

Inspired by this article:
http://blog.ptsecurity.com/2012/10/random-number-security-in-python.html

:returns:
    :class:`str` Random unguessable string.