1

I'm trying to publish my site, i configured all settings (nginx & gunicorn)

This settings works well

DEBUG=True
ALLOWED_HOSTS =  ['localhost','127.0.0.1','domain.com','www.domain.com']

However, when i edit the DEBUG=True to False

DEBUG=False

i got this error on browser Bad Request (400)

i also tried these setttings

ALLOWED_HOSTS =  ['*']
ALLOWED_HOSTS =  ['domain.com','www.domain.com']

(before posting this question i checked this answer Django gives Bad Request (400) when DEBUG = False )

Jim
  • 87
  • 1
  • 7

1 Answers1

0

did you try restarting gunicorn?: PID=$(systemctl show --value -p MainPID gunicorn.service) && kill -HUP $PID

zevloo
  • 109
  • 7
  • yes i tried, both your answer and these commands `sudo systemctl stop gunicorn.service sudo systemctl stop nginx.service sudo systemctl start nginx.service sudo systemctl start gunicorn.service` – Jim Apr 22 '21 at 17:49
  • Do you still have the .sock file in the project folder?, sometimes it gets deleted when applying changes to the project configuration. I used to have this problem when deploying in a digital ocean droplet – zevloo Apr 23 '21 at 11:56