How to log request and response for 4XX Http status in Django Rest Framework?

2019-08-21 Thread kumar deepak
The default behaviour of DRF is to throw exception for 5XX, but return valid response with error details for 4XX. I want to log request and response of any API call which fails with 4XX. Currently the log only shows Bad Request : /path/api/ -- You received this message because you are subs

Re: How to disable unique validator for a django field with unique constraint.

2019-03-14 Thread kumar deepak
t here — it’s free > forever. > <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=7ce9710f-d0c2-48a2-a0ba-76107578348e> > <#m_1721451009695702517_DAB4FAD8-2DD7-40BB-A1B8-4E

How to disable unique validator for a django field with unique constraint.

2019-03-14 Thread kumar deepak
If I have a default serializer using a django model with one of the field being unique, data will always have is_valid() False. I may be using this data for update (not create), so making this invalid does not make sense. Ideally if id (or primary key is provided), it should mean that the data