Posts

Showing posts with the label Recaptcha

How to Add reCAPTCHA to a Django Site

Image
Google’s reCAPTCHA is a very popular solution to protect your application or website against bots and spam. It is fairly simple to implement. In this tutorial you will find a working example using only built-in libraries, an alternative using  requests  and also an implementation using decorators, to reuse the reCAPTCHA verification across your application. Setup First thing, register your application in the  reCAPTCHA admin . I added the  127.0.0.1  IP address as my domain for testing purpose. Here you are supposed to add your website domain. After registering your website, you will be handed a  Site key  and a  Secret key . The  Site key  will be used in the reCAPTCHA widget which is rendered within the page where you want to place it. The  Secret key  will be stored safely in the server, made available through the  settings.py  module. settings.py GOOGLE_RECAPTCHA_SECRET_KEY = '6LdRSRYUAAAAAOnk5yom...