django recaptcha

2013-03-08 Thread Xavier Pegenaute

Dear,

I am using your django-recaptcha application but I am havig a problem. 
Seems the validation step is not done properly ONLY if I use the 
javascript code.


I've edited the django/forms/widgets.py file and added print data at 
line 209 (I am using django 1.5), once I am filling the form and click 
on submit, the console output is this one:


u'csrfmiddlewaretoken': [u'oblablaq'], u'email': [u'x...@xx.xx'], 
u'password2': [u'1']}>


And here is missing the 'recaptcha_response_field' key. Therefore, it is 
not possible to validate with the google servers.


The javascript generated inside django is this one:
-
 name='csrfmiddlewaretoken' value='oblablaq' />
Recaptcha:class="errorlist">This field is required.<tt>type="text/javascript">
</tt><pre style="margin: 0em;">
var DjangoRecaptchaOptions = {
  "lang": "en"
};
if (typeof RecaptchaOptions !== 'object') {
RecaptchaOptions = DjangoRecaptchaOptions;
} else {
for (key in DjangoRecaptchaOptions) {
RecaptchaOptions[key] = DjangoRecaptchaOptions[key];
}
}

<tt>src="<a  rel="nofollow" href="http://www.google.com/recaptcha/api/challenge?k=6blablaEhC&hl=en&quot">http://www.google.com/recaptcha/api/challenge?k=6blablaEhC&hl=en&quot</a>;>


  src="http://www.google.com/recaptcha/api/noscript?k=6blablahC=en; 
height="300" width="500" frameborder="0">

  
  value='manual_challenge' />






-

Shouldn't exist a input tag with a name attribute with the name 
'recaptcha_response_field' and the response of the google key?


Thanks a lot,
Xavi

--
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.




Re: django-recaptcha validation problems

2013-03-05 Thread Xavier Pegenaute

Hi,

Sniffing the connection, it connects to google but then always is 
sending a new captcha., how can I check if it is validating properly?


Thanks,
Xavi
On 03/05/2013 04:34 PM, Xavier Pegenaute wrote:

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 %}


{% csrf_token %}
{{ form }}




{% endblock %}
- registration_form.html -

- rendered code -

name='csrfmiddlewaretoken' value='blablaq' />
Username:class="required" id="id_username" maxlength="30" name="username" 
type="text" />
E-mail:class="required" id="id_email" maxlength="75" name="email" type="text" 
/>
Password:class="required" id="id_password1" name="password1" type="password" 
/>
Password 
(again):name="password2" type="password" />
for="id_recaptcha">Recaptcha:<tt>type="text/javascript">
</tt><pre style="margin: 0em;">
var DjangoRecaptchaOptions = {
  "lang": "en"
};
if (typeof RecaptchaOptions !== 'object') {
RecaptchaOptions = DjangoRecaptchaOptions;
} else {
for (key in DjangoRecaptchaOptions) {
RecaptchaOptions[key] = DjangoRecaptchaOptions[key];
}
}

<tt>src="<a  rel="nofollow" href="http://www.google.com/recaptcha/api/challenge?k=6blablaC&hl=en&quot">http://www.google.com/recaptcha/api/challenge?k=6blablaC&hl=en&quot</a>;>


  src="http://www.google.com/recaptcha/api/noscript?k=6blablaC=en; 
height="300" width="500" frameborder="0">
  cols="40">
  value='manual_challenge' />






- 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.




--
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.




django-recaptcha validation problems

2013-03-05 Thread Xavier Pegenaute

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 %}


{% csrf_token %}
{{ form }}




{% endblock %}
- registration_form.html -

- rendered code -

name='csrfmiddlewaretoken' value='blablaq' />
Username:class="required" id="id_username" maxlength="30" name="username" 
type="text" />
E-mail:class="required" id="id_email" maxlength="75" name="email" type="text" 
/>
Password:class="required" id="id_password1" name="password1" type="password" 
/>
Password 
(again):name="password2" type="password" />
for="id_recaptcha">Recaptcha:<tt>type="text/javascript">
</tt><pre style="margin: 0em;">
var DjangoRecaptchaOptions = {
  "lang": "en"
};
if (typeof RecaptchaOptions !== 'object') {
RecaptchaOptions = DjangoRecaptchaOptions;
} else {
for (key in DjangoRecaptchaOptions) {
RecaptchaOptions[key] = DjangoRecaptchaOptions[key];
}
}

<tt>src="<a  rel="nofollow" href="http://www.google.com/recaptcha/api/challenge?k=6blablaC&hl=en&quot">http://www.google.com/recaptcha/api/challenge?k=6blablaC&hl=en&quot</a>;>


  src="http://www.google.com/recaptcha/api/noscript?k=6blablaC=en; 
height="300" width="500" frameborder="0">

  
  value='manual_challenge' />






- 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.




Re: Problem with Django recaptcha

2012-09-06 Thread lakesh
is this a right way as stated in this website: 
http://digitaldreamer.net/blog/2010/4/15/integrating-recaptcha-contact-form-django-project/

On Friday, September 7, 2012 12:37:54 PM UTC+8, lakesh wrote:
>
> How do i set to manual? where should this go?
>
> On Thursday, September 6, 2012 2:19:29 AM UTC+8, Amyth wrote:
>>
>> This is because the re-captcha API is not able to recognize the keys ? do 
>> you have the re-Captcha settings set to automatic  by any chance ? if so 
>> change it to manual and add the domains you'd want to work it on and you 
>> should have it working...
>>
>>
>> On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen <laksh...@gmail.com> wrote:
>>
>>> I have git cloned the django-recaptcha( 
>>> https://github.com/praekelt/django-recaptcha) into my directory and 
>>> have included the public and private keys in my settings.py and captcha 
>>> = ReCaptchaField(). But i get this error everytime i run the forms: 
>>> Captcha: Input error: k: Format of site key was invalid. How do i avoid 
>>> this error? Any idea? the original question is here: 
>>> http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear. 
>>> Need some help...   
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> -- 
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras@gmail.com, ad...@techstricks.com
>> Twitter - @a_myth_
>> http://techstricks.com/
>>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/B0R0mukyQeQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with Django recaptcha

2012-09-06 Thread lakesh
How do i set to manual? where should this go?

On Thursday, September 6, 2012 2:19:29 AM UTC+8, Amyth wrote:
>
> This is because the re-captcha API is not able to recognize the keys ? do 
> you have the re-Captcha settings set to automatic  by any chance ? if so 
> change it to manual and add the domains you'd want to work it on and you 
> should have it working...
>
>
> On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen <laksh...@gmail.com 
> > wrote:
>
>> I have git cloned the django-recaptcha( 
>> https://github.com/praekelt/django-recaptcha) into my directory and have 
>> included the public and private keys in my settings.py and captcha = 
>> ReCaptchaField(). But i get this error everytime i run the forms: 
>> Captcha: Input error: k: Format of site key was invalid. How do i avoid 
>> this error? Any idea? the original question is here: 
>> http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear. 
>> Need some help...   
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras@gmail.com , ad...@techstricks.com
> Twitter - @a_myth_
> http://techstricks.com/
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/IdJCmdwWGBYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with Django recaptcha

2012-09-05 Thread Amyth Arora
This is because the re-captcha API is not able to recognize the keys ? do
you have the re-Captcha settings set to automatic  by any chance ? if so
change it to manual and add the domains you'd want to work it on and you
should have it working...


On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen <lakshme...@gmail.com> wrote:

> I have git cloned the django-recaptcha(
> https://github.com/praekelt/django-recaptcha) into my directory and have
> included the public and private keys in my settings.py and captcha =
> ReCaptchaField(). But i get this error everytime i run the forms: 
> Captcha:Input error: k: Format of site key was invalid. How do i avoid this 
> error?
> Any idea? the original question is here:
> http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear. 
> Need some help...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @a_myth_
http://techstricks.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Problem with Django recaptcha

2012-09-05 Thread Lakshmen
I have git cloned the 
django-recaptcha( https://github.com/praekelt/django-recaptcha) into my 
directory and have included the public and private keys in my settings.py 
and captcha = ReCaptchaField(). But i get this error everytime i run the 
forms: Captcha: Input error: k: Format of site key was invalid. How do i 
avoid this error? Any idea? the original question is here: 
http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear 
. Need some help...  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.