Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In the <code>settings.py</code> in the original code that you <a href="https://dl.dropbox.com/u/2490888/heroku.zip" rel="nofollow">linked</a> to, it seems that you have two contradictory declarations for your <code>DATABASES</code> setting:</p> <p>1) line 3:</p> <pre><code>DATABASES = {'default': dj_database_url.config(default='postgres://localhost')} </code></pre> <p>2) line 16:</p> <pre><code>DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'traineeworld', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } </code></pre> <p>3) Also, the additional code of your latest edit looks like yet another method to specify the connection arguments, that probably negates again the effects of the previous declarations.</p> <p>These methods are not meant to be piled onto each other. You want to choose only one.</p> <p>Also, technically, as the initiator of a client-side connection to a db server, you're supposed to <strong>know</strong> if the server is to be reached through TCP (and in this case its hostname or IP address plus port), or through a Unix domain socket file, and in that case its full directory path (starting with a slash). In both cases, this goes into the <code>HOST</code> part of the connection parameters.</p> <p>Postgres provides default values for all of these, but as soon as you mix and match different software parts from different sources, these defaults no longer help and giving explicit values becomes a requirement.</p> <p>When in doubt about the socket's path, inside <code>psql</code> when connected as the postgres user, this path can be obtained by the SQL command:</p> <pre><code>SHOW unix_socket_directory; </code></pre> <p>This setting is also present in the server-side <code>postgresql.conf</code> configuration file.</p>
 

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