Django validating form data
Imagine that you have a model form with excellent test coverage for it, but then your colleague adds a model admin for it and all your validation logic is bypassed.
We need to do a little bit more work in our As we have recently used the Django admin interface, the system currently thinks we are still logged in. Django is taking care to validate that all the fields in our form are correct. Let's make it so the button shows up for you but not for anyone else.
Remember the edit icon we just added to our detail page?
We also want to add the same change there, so other people won't be able to edit existing posts.
When it comes to validation, we all have similar concerns.
Firstly, there is enforcement — how can you ensure that your validation logic runs?
And finally, convenience — is the logic easy to change? The drawback is that it needs to be duplicated on the server side for security reasons and also on the backend: you cannot trust anything coming from the frontend.2.