Access to Django settings using Redis
<p>I have a project on Heroku. I just recently added Redis for job queueing through Heroku's add-ons feature.</p>

<p>I've followed Heroku's simple <a href="https://devcenter.heroku.com/articles/python-rq" rel="nofollow">tutorial</a> to get things up and running.</p>

<p>I call the function like so:
<code>result = q.enqueue(some_other_class.some_function, some_argument)</code></p>

<p>In <code>some_function</code> there is a call to a variable from the Django's settings file.  I follow the normal procedure, which works without Redis: <code>from django.conf import settings</code> and then get the variable <code>settings.THE_VARIABLE</code>.</p>

<p>When I use Redis though, that doesn't work.  I get the error: </p>

<p><code>ImproperlyConfigured: Requested setting THE_VARIABLE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings</code></p>

<p>The <code>DJANGO_SETTINGS_MODULE</code> variable is set. Does the worker not have access to Django settings?  If so, how can I get around this?</p>

<p>Someone with the power please close this question.</p>

<p>It turns at that <code>DJANGO_SETTINGS_MODULE</code> was not set properly.</p>

python django heroku