#NEWLINE# def captcha_refresh( request ) : #NEWLINE# #INDENT# '  Return json with new captcha for ajax refresh request ' #NEWLINE# if ( not request . is_ajax ( ) ) : #NEWLINE# #INDENT# raise Http404 #NEWLINE# #UNINDENT# new_key = CaptchaStore . generate_key ( ) #NEWLINE# to_json_response = { #NEWLINE# #INDENT# 'key' : new_key , #NEWLINE# 'image_url' : captcha_image_url ( new_key ) , #NEWLINE# #UNINDENT# } #NEWLINE# return HttpResponse ( json . dumps ( to_json_response ) , content_type = 'application/json' )