Note that there are some explanatory texts on larger screens.

plurals
  1. POHeroku Django Celery: NameError: name 'DATABASES' is not defined
    text
    copied!<p>I am following along <a href="http://devcenter.heroku.com/articles/django" rel="noreferrer">this</a> tutorial to get celery and django running on heroku. </p> <p>However, I get this error in my logs when I put in the specified code for the worker:</p> <pre><code>2011-12-22T05:31:56+00:00 heroku[web.1]: Starting process with command `python canada/manage.py run_gunicorn -b "0.0.0.0:47336" -w 3` 2011-12-22T05:31:56+00:00 app[web.1]: Unexpected error: (&lt;type 'exceptions.NameError'&gt;, NameError("name 'DATABASES' is not defined",), &lt;traceback object at 0x11a9560&gt;) 2011-12-22T05:31:56+00:00 app[web.1]: Traceback (most recent call last): 2011-12-22T05:31:56+00:00 app[web.1]: File "canada/manage.py", line 11, in &lt;module&gt; 2011-12-22T05:31:56+00:00 app[web.1]: import settings 2011-12-22T05:31:56+00:00 app[web.1]: File "/app/canada/settings.py", line 51, in &lt;module&gt; 2011-12-22T05:31:56+00:00 app[web.1]: CELERY_RESULT_DBURI = DATABASES['default'] 2011-12-22T05:31:56+00:00 app[web.1]: NameError: name 'DATABASES' is not defined 2011-12-22T05:31:57+00:00 heroku[slugc]: Slug compilation finished 2011-12-22T05:31:57+00:00 heroku[web.1]: State changed from starting to crashed 2011-12-22T05:31:58+00:00 heroku[web.1]: Process exited </code></pre> <p>My settings.py looks like</p> <pre><code>import djcelery djcelery.setup_loader() BROKER_BACKEND = "djkombu.transport.DatabaseTransport" CELERY_RESULT_DBURI = DATABASES['default'] ... </code></pre> <p>When I synced before adding this line, <code>CELERY_RESULT_DBURI = DATABASES['default']</code>, it ran fine. According to <a href="http://devcenter.heroku.com/articles/django#postgres_database_config" rel="noreferrer">the document</a></p> <blockquote> <p>When you deploy a Django application, the compile process appends the following code to your settings.py to use the DATABASE_URL environment variable:</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload