Задать вопрос

Тел: +7 965 3737 888

453

Просмотров

1

Ответов

Captcha without Freetype or the Python Imaging Library (PIL)

<p>If, like me, you've had trouble installing the <a href="http://www.pythonware.com/products/pil/">Python Imaging Library</a> or <a href="http://freetype.sourceforge.org">FreeType</a>, you may have also had trouble getting a captcha to work. Here's my quick and dirty workaround &#8212; be warned, this is <em>very</em> low level security, and shouldn't be used on high-profile sites.</p>
<p>Originally published at <a href="http://gregbrown.co.nz/code/django-captcha-without-freetype-or-pil/">http://gregbrown.co.nz/code/django-captcha-without-freetype-or-pil/</a></p>
<p>Credit to the author of <a href="http://code.google.com/p/django-simple-captcha/">django-simple-captcha</a>, from whom I borrowed most of this code.</p>
<h3>Usage</h3>
from django import forms
from ABOVE-FILE import CaptchaField

class CaptchaTestForm(forms.Form):
    myfield = forms.TextField()

    security_check = CaptchaField()

Вопрос полезен? Да0/Нет0
file_2547.py(1.6Кб)
None

Ответы (1):

Ответgregb:07.06.2009
Ответ полезен? Да0/Нет0

Yeah, I linked to that in the description of this snippet... the point of this script is to provide a captcha which doesn't rely on freetype - it uses a plain text question (ie "What is 3 + 4?") instead of an image.