@anonymous_csrf
def handle403(request):
    no_cookies = False
    referer = request.META.get('HTTP_REFERER')
    if referer:
        no_cookies = (referer.endswith(reverse('users.login')) or
                      referer.endswith(reverse('users.register')))

    return render(request, 'handlers/403.html', {
        'form': AuthenticationForm(),
        'no_cookies': no_cookies},
        status=403)
A 403 message that looks nicer than the normal Apache forbidden page
dataset/ETHPy150Open mozilla/kitsune/kitsune/sumo/views.py/handle403