Django settings.py not updating
<p>I have enabled the setting:</p>

<p><code>USE_X_FORWARDED_HOST = True</code></p>

<p>in my settings.py. I am currently deploying the server, but when I try to render my index page it gives me a 404. The email says that it is a:</p>

<p><code>Invalid HTTP_HOST header: u'127.0.0.1:9001</code></p>

<p>And BEFORE ANYONE SAYS THAT I NEED TO ADD IT TO MY ALLOWED_HOSTS, I already have, so please spare me with from that advice. I also received an email with the debug error. When I looked through the debug info, it had a list of my settings and it stated that:</p>

<pre><code>USE_X_FORWARDED_HOST = False
</code></pre>

<p>Another field that is not being updated is my ALLOWED_HOSTS. I tried restarting apache2, touching wsgi.py, and deleting *.pyc in the main app directory that contains settings.pyc. However, none of this has worked.</p>

<p>Some background on my deployment. I have my django behind a proxy because I am using django channels with an apache2 webserver serving as the proxy. I also have daphne running behind it which receives the requests and services them.</p>

<p>Solved the problem. The redis server had to be restarted everytime the settings.py was updated for some reason.</p>

python django django-settings django-deployment django-channels