How does Django protect against SQL Injection, Cross-Site Request Forgery (CSRF), and Cross-Site Scripting (XSS) by default?
Last updated
SQL injection: the ORM uses parameterized queries. Risk returns only with hand-built strings in
.raw()orcursor.execute.CSRF:
CsrfViewMiddlewarerequires a secret token on unsafe methods (POST/PUT/DELETE), which cross-site attackers can't read or forge.XSS: templates auto-escape variables. Opting out via
|safe,mark_safe()or@csrf_exemptdisables the respective protection.
- https://www.interviewbit.com/django-interview-questions/
- https://www.scribd.com/document/911648753/Headout-Backend-Engineering-Interview-Questions-Bank-CLAUDE
- https://www.uplers.com/
- https://medium.com/@anas-issath/the-django-career-guide-from-junior-to-senior-fea1c3e52aa6
- https://www.quora.com/What-are-some-interview-questions-asked-or-can-be-asked-related-to-Django-and-Python
- https://www.reddit.com/r/developersIndia/
- https://internshala.com/blog/infosys-python-interview-questions/