14👍
✅
I found the solution as I was trying to make changes in /etc/nginx/sites-available/django-project
. But I needed to add following lines in /etc/nginx/nginx.conf
the global settings for Nginx. Lines I’ve added are:
http {
...
proxy_connect_timeout 10;
proxy_send_timeout 15;
proxy_read_timeout 20;
}
I have a small website hosted and this one above settings are enough. But others may set their settings according to their needs.
15👍
If you are using uwsgi with django, then you might add uwsgi_read_timeout directive to nginx’s config file at location place
location / {
uwsgi_read_timeout 120;
}
- Ruby HAML with Django?
- Django – Access ForeignKey value without hitting database
- How to import my django app's models from command-line?
- Tastypie filtering with multiple values
6👍
I know I’m late to the party here but after trying many of these suggestions (and others) I eventually found the timeout for me was occurring from my DNS – if you’re using Amazon load balancers they have an “Idle timeout” set at 120s default.
Source:stackexchange.com