There isn't a native request timeout in Django, however you can configure your hosting WSGI server (at least gunicorn and uWSGI) to have a request timeout, and indeed it's recommended. I'm not sure how hard it would be to implement this (reliably, for all cases and platforms) inside Django.
On 26 December 2017 at 10:54, Pankhuri Agarwal <[email protected]> wrote: > I would like to know if there is any django rest native method to add > request timeouts at API level. > > Any api having request timeout set to x ms should return response > {'status_code': 408, 'message': 'Request Timeout'} after x ms if no other > response is returned till that time. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-developers/3deae2cf-c2db-45c0-a12c- > c5bae84e0c5b%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/3deae2cf-c2db-45c0-a12c-c5bae84e0c5b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0L6%2Bkb0WanHOZ96YiYPJTKh4uSGVxR_Fh5Xd5JBX%3Dw3A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
