def lucky_number(request):

    # Check that the user is authenticated.
    userid = authenticated_userid(request)
    if userid is None:
        raise Forbidden()

    # Generate and return the lucky number.
    number = random.randint(1,100)
    return Response(TEMPLATE.format(**locals()), content_type="text/plain")
Creates a class-wide instance property with a thread-specific value.
dataset/ETHPy150Open wichert/rest_toolkit/demos/macauth_demo.py/lucky_number--crossover with--dataset/ETHPy150Open adieu/djangotoolbox/djangotoolbox/utils.py/make_tls_property