I had the same problem and none of the answers resolved my problem, for resolving the situation like this it's better to enable logging by adding the following config to settings.py
temporary
LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'file': { 'level': 'DEBUG', 'class': 'logging.FileHandler', 'filename': '/tmp/debug.log', }, }, 'loggers': { 'django': { 'handlers': ['file'], 'level': 'DEBUG', 'propagate': True, }, }, }
and try to tail -f /tmp/debug.log
.
and when you see your issue you can handle it much easier than blind debugging.
My issue was about to
Invalid HTTP_HOST header: 'pt_web:8000'. The domain name provided is not valid according to RFC 1034/1035.
and resolve it by adding proxy_set_header Host $host;
to Nginx config file and enabling port forwarding by USE_X_FORWARDED_PORT = True
in the settings.py
( it's because in my case I've listened to request in Nginx on port 8080
and pass it to guni
on port 8000