Question

I have an app that uses Django with FCGI on nginx. I'm using the third-party apps like James Bennett's django-registration and django-messages from the Pinax Project. Both of these apps have forms that are submitted and save data into the database, then redirect on to a new URL.

My issue seems to be that the .save() method on any of the forms in these apps cause a 504 gateway time-out when the forms are submitted. All of the data is saved in the database as it should be, however neither seems to ever return anything to the app after the form is saved.

I've done some logging at various points in the code and there are no errors. It's as if the save() methods on the form or the models the forms are connected to simply never return anything--error or otherwise.

With this lack of detail, an answer might be a dream for me, but just a nudge in the right direction or a way to diagnose the issue more completely would be fantastic.

Was it helpful?

Solution 2

Turns out the problem was completely unrelated to nginx, but was Django having a timeout when trying to send an email. Unfortunately, it doesn't drop an error message or any indication that it can't connect to the email server.

OTHER TIPS

Typically 504's in nginx happen due to timeout between nginx and the fastcgi process. You may want to take a look at your nginx settings and up the fastcgi_read_timeout setting?

Your nginx error log will typically provide a bit more information as to why things are not working as well. If you're on a *nix distro it's typically in "/var/log/nginx/error.log"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top