I have a general question about Django forms (specifically, a contact form) when it comes to security precautions. Should I use a CAPTCHA? Do forms written with Python not suffer the same problems as PHP ones?
I have a general question about Django forms (specifically, a contact form) when it
Share
Django forms have built in protection against CSRF (a.k.a. XSRF), which is a kind of attack that allows a hacker to post stuff to your site without the logged in user meaning to. PHP doesn’t.
Captchas will protect against CSRF, but they’re more normally used to protect against robots filling out your form without a human involved.
So it depends what you’re trying to protect against. If you want to reduce spam or similar mischeif, use a Captcha as you would in PHP. If all you’re worried about is CSRF, then don’t bother.