{{image}}{{hidden_field}}{{text_field}}

<script>
    function refresh_captcha() {
        $.getJSON("{% url "captcha-refresh" %}",
                function (result) {
                    $('.captcha').attr('src', result['image_url']);
                    $('#id_captcha_0').val(result['key'])
                })
    }
    $('.captcha').click(refresh_captcha)
</script>