Answer the question
In order to leave comments, you need to log in
How to add Django Simple Captcha to template?
Hello.
Tell me please.
Downloaded Django Simple Captcha and started installing.
#forms.py
from captcha.fields import CaptchaField
class RegistrationForm(ModelForm):
username = forms.CharField(label = (u'User Name'))
email = forms.EmailField(label = (u'Email Address'))
password = forms.CharField(label = (u'Password'), widget = forms.PasswordInput(render_value = False))
password1 = forms.CharField(label = (u'Verify Password'), widget = forms.PasswordInput(render_value = False))
captcha = CaptchaField()
class Meta:
model = Person
exclude = ('user',)
#urls.py
urlpatterns += patterns('',
url(r'^captcha/', include('captcha.urls')),
)
Answer the question
In order to leave comments, you need to log in
1. In the installation description there is an item that PIL with FreeType support must be installed.
2. A similar problem is described here . In the answers to the question, it is advised to check through the test whether all the captcha dependencies are installed, to do this, go to the project directory and run the manage.py test captcha command , which will show if everything is ok.
Maybe django will give some additional information if you try to open the image directly at the src address of the img tag?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question