Ask Your Question
1

"Input error: k: Format of site key was invalid" when reCAPTCHA is turned on

asked 2012-03-24 10:28:46 -0600

todofixthis gravatar image

updated 2012-04-14 15:39:50 -0600

I had reCAPTCHA turned on in /settings/EXTERNAL_KEYS/ on my hosted site, but when people went to create new accounts, they saw the following instead of the reCAPTCHA interface:

Please read and type in the two words below to help us prevent automated account creation.
Input error: k: Format of site key was invalid

I double-checked, and I did input my reCAPTCHA exactly as it appears on my account info on http://google.com/recaptcha.

For reference, here are the keys I was using (they have since been deleted, so they won't work anymore):

  • Public Key: 6Ld7UM8SAAAAAGrn74ADTPQLi8DfYikQH3_WmkgA
  • Private Key: 6Ld7UM8SAAAAAB-pIUr_5ki8PTuWWMLDf0eYo3DX
edit retag flag offensive close merge delete

Comments

1

Got the same error. Be sure to restart your server after saving the new settings for reCaptcha.

nr gravatar imagenr ( 2012-09-12 05:58:35 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2012-04-15 16:53:39 -0600

Evgeny gravatar image

updated 2012-04-15 16:53:54 -0600

I don't know exactly why, but adding to settings.py RECAPTCHA_USE_SSL = True solves this problem for me.

Possibly Google (current owner of the service) now requires encryption... We'll add this setting to the future release and the hosted sites.

edit flag offensive delete link more

Comments

Applied to the hosted sites.

Fitoria gravatar imageFitoria ( 2012-04-16 14:27:32 -0600 )edit

@todofixthis - does ReCaptcha work for you now?

Evgeny gravatar imageEvgeny ( 2012-04-17 15:50:39 -0600 )edit

Generated new public/private keys and turned recaptcha on, but getting the same error as before when I go to create an account.

todofixthis gravatar imagetodofixthis ( 2012-04-17 16:19:42 -0600 )edit
0

answered 2013-06-23 14:27:34 -0600

A. Pritschet gravatar image

updated 2013-06-23 14:30:38 -0600

Have the exact same problem and took the liberty of taking a look at the HTML code of the page and the settings.py of the recaptcha module. I think I found the source of the error:

_RECAPTCHA_HTML = u'''
%(options)s
<script type="text/javascript"
   src="%(proto)s://www.google.com/recaptcha/api/challenge?k=%(public_key)s">
</script>
<noscript>
   <iframe src="%(proto)s://www.google.com/recaptcha/api/noscript?k=%(public_key)s"
       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>
'''

As you can see, there are three variables options, proto and public_key supposed to be rendered into the string, but nothing is defined!

A quick and dirty solution is to replace %(public_key)s with your actual public key...

edit flag offensive delete link more
0

answered 2014-04-09 04:38:34 -0600

One quick thing to check is if you switched from an AJAX display for your captcha to a PHP based display and left in:

showRecaptcha(element)

Then comment out that function / function call, took me a while to figure out because it would only error out every 2/5 times depending on how fast the JavaScript loaded.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-03-24 10:28:46 -0600

Seen: 26,195 times

Last updated: Apr 09 '14