0

So I am building a web tool using Django REST API and Angular JS. I have CSRF protection built into the bootstrapped template. My question is, do I have to do server validation of the POST information when submitted on a form?

I am used to doing all the validation server side, but with the CSRF stuff and how the REST API works, I don't know if I need to? For instance if I want to validate that a piece of the form is only alphanumeric etc to prevent injections and such.

Thanks.

1 Answer 1

2

Django does a pretty good job when it comes to validation, so SQL injection shouldn't be your concern as long as you don't write raw queries - see here for more explanations.

However, if you have specific validation that you want and that is not enforced by django (such as not allowing a user to have a password length smaller than 8), you should definitely do it on the server side, even if you are already doing it in Angular.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.