Django doesn't reflect changes made to in production

June 25, 2017 7.3k views
Django Nginx

I successfully got my Django application my server. However, I realized that I accidentally left DEBUG=True in my file. I tried setting DEBUG=False in the file, but the website won’t reflect that change. I also tried doing sudo service nginx restart but that didn’t put the change on the website. What do I need to do to get the change in effect?

As an additional note, I followed the tutorial below to get my project into production.

1 comment
  • I’m having this issue. Usually I use this command after making changes in production:

    system gunicorn restart

    But DEBUG is still showing as True even though in my file it is set to False.

2 Answers

Hi @leebr1

When doing changing to the project, restarting Nginx doesn’t do a lot, since Nginx is just proxying data between the visitor and Gunicorn, so restart Gunicorn instead:

sudo systemctl restart gunicorn
Have another answer? Share your knowledge.