|
CaptchaConfiguration
Django Simple CaptchaConfigurationThe following configuration elements can be defined (in your settings.py) CAPTCHA_FONT_PATHFull path and filename of a TrueType (TTF), OpenType, or pilfont font file used to render text. Defaults to: fonts/Vera.ttf (included in the application, GPL font). Note that your PIL installation must support TTF and/or OpenFont if you want to use this kind of glyphs (most modern distributions of PIL do.) CAPTCHA_FONT_SIZEFont-size in pixels of the rendered text. Defaults to '22'. CAPTCHA_LETTER_ROTATIONA random rotation in this interval is applied to each letter in the challenge text. Defaults to (-35,35). New in version 0.1.6: set this to None to disable letter roation. CAPTCHA_BACKGROUND_COLORBackground-color of the captcha. Can be expressed as html-style #rrggbb, rgb(red, green, blue), or common html names (e.g. "red"). Defaults to: '#ffffff' CAPTCHA_FOREGROUND_COLORForeground-color of the captcha. Defaults to '#001100' CAPTCHA_CHALLENGE_FUNCTString representing a python callable (i.e. a function) to use challenge generator. See CaptchaGenerators for a list of available generators and a guide on how to write your own. Defaults to: 'captcha.helpers.random_char_challenge' CAPTCHA_NOISE_FUNCTIONSList of strings of python callables that take a PIL DrawImage object and an Image iamge as input, modify the DrawImage, then return it. Defaults to: ('captcha.helpers.noise_arcs','captcha.helpers.noise_dots',) CAPTCHA_FILTER_FUNCTIONSList of strings of python callables that take a PIL Image object as input, modify it and return it. These are called right before the rendering, i.e. after the noise functions. Defaults to: ('captcha.helpers.post_smooth',) CAPTCHA_WORDS_DICTIONARYRequired for the word_challenge challenge function only. Points a file containing a list of words, one per line. Defaults to: '/usr/share/dict/words' CAPTCHA_FLITE_PATHFull path to the flite executable. When defined, will automatically add audio output to the captcha. Defaults to: None (no audio output) CAPTCHA_TIMEOUTInteger. Lifespan, in minutes, of the generated captcha. Defaults to: 5 CAPTCHA_LENGTHSets the length, in chars, of the generated captcha. (for the 'captcha.helpers.random_char_challenge' challenge) Defaults to: 4 CAPTCHA_DICTIONARY_MIN_LENGTHWhen using the word_challenge challenge function, controls the minimum length of the words to be randomly picked from the dictionary file. Defaults to: 0 CAPTCHA_DICTIONARY_MAX_LENGTHWhen using the word_challenge challenge function, controls the maximal length of the words to be randomly picked from the dictionary file. Defaults to: 99 Note: it's perfectly safe to specify e.g. CAPTCHA_DICTIONARY_MIN_LENGTH = CAPTCHA_DICTIONARY_MAX_LENGTH = 6 but it'd considered an error to define CAPTCHA_DICTIONARY_MAX_LENGTH to be smaller than CAPTCHA_DICTIONARY_MIN_LENGTH. CAPTCHA_OUTPUT_FORMATNew in version 0.1.6 Specify your own output format for the generated markup, when e.g. you want to position the captcha image relative to the text field in your form. Defaults to: u'%(image)s %(hidden_field)s %(text_field)s' Note: the three keys have to be present in the format string or an error will be thrown at runtime. |
Hey, really great work you've done with this! Very useful, I'm using it in my next project...
Thanks
I'm using this in my project as well. It'd be nice if it was easier to make the random_char challenge produce a longer string without hard coding it though. The change was easy to make, but I have to remember that I made that edit from now on. :) Love the project though, saved me a bunch of time.
It's really useful :)
Really easy to use! Thank you!
Really great work! Thank you Sir!!
super simple to implement, thx!
I'm quite new to django, I've follow the procedure to install captcha, the form works but the browser don't load the image. I'm using the django development web server, and I think that can't serve the captcha images. Am I right? How can i make things work?
Thanks!
Check your urls.py and add '^captcha/' line properly, for me it was creating same problem.
Hello thank you for great Captcha we use it on http://userecho.com
Fantastic project! Followed the installation instructions and got it working with django-cms immediately. Where is the donation button :)
For those using Debian lenny, don't install the PIL dependency via easy_install PIL. Instead do sudo apt-get python-imaging. Didn't work until I deleted the egg that the former installed.
Thanks ! Small question, how can I pass an attribute to the CaptchaField? so I can style it using css ?
Very nice. Small, quick and to the point but doing what it does well. Thanks for sharing.
I can't get it to work django 1.1?: added everything as needed but the captcha form doesn't display.. I'm using it with django-cms, do u have any report of incompatibilities? (maybe due to the way the cms handles the urls..) p.s. I can go to /captcha/image/aaaa/ and get the error message 'No CaptchaStore? matches the given query.'.. so I guess the urls are wired up correctly. thanks..
I finally have everything working when Captcha is called from the test page. I was wondering however if anyone can give me some pointers on integrating CAPTCHA through a Django View (front end) through the views.py??
Thanks again for an EXCELLENT CAPTCHA option.
Thank you. A great project. It was Very usefull and extremly simple to setup.
Very nice. Could I suggest changing captcha/views.py to use something like settings.CAPTCHA_IMAGE_FORMAT instead of hardcoding the image format and its content-type?
Simple, Elegant, Efficient!!!
Truly great!
good job thank you!
great work. easy to set up. Thank you.