Published on 20 May 2015

SweetCaptcha for Django and Wagtail

At Springload, the place I currently work, we've recently released Made with Wagtail, a showcase of websites built with the Wagtail CMS. I recommend you guys to check it out if you're interested in this cool CMS built on top of Django.

One of the many cool features this CMS ships with is the form builder. It allows you to create a form page from the admin backend choosing the number of field you want. It also comes with a default interface where and administrator can see the submissions and their values. Cool stuff!!

Unfortunately, it doesn't give you the option to add a captcha field to the form. That why I thought of somehow, try to integrate SweetCaptcha in the builder. I previously built a plugin to integrate it with Laravel so I knew it wasn't a complicated job.

After looking around for some existing stuff, I found an existing Python package, from where I took the main client class. First I did the Django field, wrapping it in a package, the repo being in https://github.com/jordij/django-sweetcaptcha

Then I did the Wagtail integration, you can access the repo in https://github.com/jordij/wagtailsweetcaptcha

Installation and usage is really easy. Once you've installed and done the settings, you just need to declare you FormPage class inheriting from one the available form classes in the package, depending if you'd like to enable email notification for each form submission or not. As I said it's pretty straightforward, in case of doubts read the docs or send me message.

Enjoy!