Captcha & reCaptcha For Django

Django Crafts (4 Part Series)

1 Django 2FA With Google Authenticator
2 Role-Based Access Control in Django
3 Implementing SSO In Your Django Project
4 Captcha & reCaptcha For Django

Website and Web application today are about 1,119,023,272 with about 177,372 deployed everyday (ref: explodingtopics.com). With this knowledge you will understand how much security is needed when to comes these platforms coming up everyday. Who talks about web apps talks about “potential data source”, here we go. Let’s explore some measures taken by web developers to avoid automated bots, reducing spam, securing online polls & surveys, blocking credential stuffing attacks, mitigating DDoS attacks, preventing fake reviews, protecting against brute force attacks, reducing ticket scalping, safeguarding e-commerce transactions, and enhancing AI training.

Wait a minute… But what is Captcha or reCaptcha? Let me tell you.

What is Captcha and reCaptcha?

With the need to make our applications more secure and also keep bots and scrapers away, we use captcha.

The workflow of reCAPTCHA goes like this: When a user submits a form on a protected page, Google’s reCAPTCHA kicks in to verify if the user is a human or a bot. The backend server sends Google’s public key to generate a temporary token, which is then sent back to the user’s browser. This token is submitted along with the form data to the backend, which uses it alongside a secret key to request a score from Google’s API. The score (default 0.5) determines if the user is likely a human. If the score is high enough, the backend logic proceeds; otherwise, it blocks the request. This process happens seamlessly in the background, ensuring security without interrupting the user experience.

Let’s CRAFT!!!

Specially today, we won’t have code snippets here, we will be going with full codebase on GitHub.

Outcome

Wrapping Up

I hope this brought some better enlightenment and good understanding of how captcha and recaptcha works.

Django Crafts (4 Part Series)

1 Django 2FA With Google Authenticator
2 Role-Based Access Control in Django
3 Implementing SSO In Your Django Project
4 Captcha & reCaptcha For Django

原文链接:Captcha & reCaptcha For Django

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
Misery can be caused by someone being just weak and indecisive.
一个人仅仅因为软弱无能或优柔寡断就完全可能招致痛苦
评论 抢沙发

请登录后发表评论

    暂无评论内容