Django Captcha app

Posted by Ian Holsman Thu, 15 Dec 2005 18:23:00 GMT

Standing on the shoulders of giants, I have integrated pycaptcha with the Django Framework.

Django Captcha is available via SVN.

to use you will need to install it as any regular app, but you will need to create a ‘chained’ view so that the captcha view first verifies the validity of the captcha, and then passes it to the view of your choice.

comments/critcisms are of course welcome. (as are patches)

Posted in  | Tags ,  | 5 comments | no trackbacks

Comments

  1. Avatar feiyu.xie@gmail.com said 6 days later:

    HI!, Being a newbie in Django and Python I’m lost trying to figure out how to use the Django Captcha app, even after read the code and your README. Could you give any detailed sample code on how to use it? For example, I have a separate app called foo, which has it’s own urls.py and views.py, in the urls.py there was a pattern like: (r’^submit/$’, ‘myproject.apps.foo.views.create_story), which is the url / view I intended to add an captcha onto. How should I modify my code (and yours maybe) to make use of the captcha?

    many thanks in advance!

    Feiyu

  2. Avatar Ian Holsman said 6 days later:

    try this:

    1. in your template add {% load captcha %} {% captcha %} inside of the form.

    2. your url.py from: (r’submit/$’, ‘myproject.apps.foo.views.create_story) to: (r’submit/$’, ‘path.captcha.views.verify’, dict( foward_to=‘myproject.apps.foo.views.create_story))

  3. Avatar feiyu.xie@gmail.com said 6 days later:

    I’ve got this working now. One issue with the captcha/views.py and captcha.py is that they used a unix style temp directory to store the generated jpeg files, which doesn’t work for me on my Windows XP… :(

    I changed them to “C:\\pycaptcha_%d” and it worked!

    I guess we will need a better solution than that. For the views we can just pass in the path in the dict, but how to do that in the templatetags?

  4. Avatar Ian Holsman said 7 days later:

    people might also be interested in the Django Gatekeeper

  5. Avatar try ruby said 11 days later:

    feiyu, have you tried rubyonrails ? you might want to take a look at that one as well.

    Ruby is not as feindishly puritan as Python, which is no doubt a very powerful language, its just that it is just extremely new user un-friendly.

    you can try the ruby language at http://tryruby.hobix.com

    its a silly little toy language, but it does most things reasonably well.

Trackbacks

Use the following link to trackback from your own site:
http://feh.holsman.net/trackbacks?article_id=django-captcha-app&day=15&month=12&year=2005

Comments are disabled