>>> from django.db import connection
>>> cursor = connection.cursor()
>>> from django.db import connection
>>> cursor = connection.cursor()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/__init__.py", line 81, in cursor
cursor = self._cursor()
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 98, in _cursor
self.connection = Database.connect(**conn_params)
OperationalError: FATAL: Ident authentication failed for user "nr_user"
sudo su postgres
createuser -W nr_user
jkz
createdb -O nr_user nr_db
settings
DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'nr_db' # Or path to database file if using sqlite3.
DATABASE_USER = 'nr_user' # Not used with sqlite3.
DATABASE_PASSWORD = 'jkz' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '5432' # Set to empty string for default. Not used with sqlite3.
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5