Hi,
I am using django-recaptcha and I want to use it inside the registration
form. In the website [1], inside the Field section says: "A ReCaptcha
widget will be rendered with the field validating itself without any
further action required from you". Actually seems is not validating
anything. Anyone had similar experience?
Thanks.
----------------------------- forms.py -----------------
from registration.forms import RegistrationFormUniqueEmail
from captcha.fields import ReCaptchaField
class RecaptchaRegistrationForm(RegistrationFormUniqueEmail):
recaptcha = ReCaptchaField()
----------------------------- forms.py -----------------
----------------------------- urls.py -----------------
url(r'^accounts/register/$', register, { # Overwrite registration url
'backend': 'registration.backends.default.DefaultBackend',
'form_class': RecaptchaRegistrationForm,
}, name='registration_register'),
url(r'^accounts/', include('registration.backends.default.urls')),
----------------------------- urls.py -----------------
----------------------------- registration_form.html -----------------
{% extends "base.html" %}
{% block title %}Register for an account{% endblock %}
{% block container %}
<table>
<form method='post' action=''>{% csrf_token %}
{{ form }}
<tr><td></td><td><input type="submit" value="Send activation
email" /></td>
</form>
</table>
{% endblock %}
----------------------------- registration_form.html -----------------
----------------------------- rendered code -----------------
<form method='post' action=''><input type='hidden'
name='csrfmiddlewaretoken' value='blablaq' />
<tr><th><label for="id_username">Username:</label></th><td><input
class="required" id="id_username" maxlength="30" name="username"
type="text" /></td></tr>
<tr><th><label for="id_email">E-mail:</label></th><td><input
class="required" id="id_email" maxlength="75" name="email" type="text"
/></td></tr>
<tr><th><label for="id_password1">Password:</label></th><td><input
class="required" id="id_password1" name="password1" type="password"
/></td></tr>
<tr><th><label for="id_password2">Password
(again):</label></th><td><input class="required" id="id_password2"
name="password2" type="password" /></td></tr>
<tr><th><label
for="id_recaptcha">Recaptcha:</label></th><td><script
type="text/javascript">
var DjangoRecaptchaOptions = {
"lang": "en"
};
if (typeof RecaptchaOptions !== 'object') {
RecaptchaOptions = DjangoRecaptchaOptions;
} else {
for (key in DjangoRecaptchaOptions) {
RecaptchaOptions[key] = DjangoRecaptchaOptions[key];
}
}
</script>
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=6blablaC&hl=en"></script>
<noscript>
<iframe
src="http://www.google.com/recaptcha/api/noscript?k=6blablaC&hl=en"
height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type='hidden' name='recaptcha_response_field'
value='manual_challenge' />
</noscript>
</td></tr>
<tr><td></td><td><input type="submit" value="Send activation
email" /></td>
</form>
----------------------------- rendered code -----------------
The Exact version I am using are:
Django==1.5
django-recaptcha==0.0.6
django-registration==0.8
recaptcha-client==1.0.6
[1] - https://github.com/praekelt/django-recaptcha
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.