On Sat, 21 Jul 2012 06:38:34 -0700 (PDT), Juraj Malenica
<juraj.malenica@gmail.com> declaimed the following in
gmane.comp.python.django.user:
Caveat: I don't run PostgreSQL (my system is running MySQL -- a
decade ago PostgreSQL was difficult to run on a Windows machine; newer
versions appear to have native installers rather than requiring Cygwin)
AND my PostgrSQL books are also that old (covering versions around
7.1.2, whereas the current version is 9.1.4)
> Hello-
>
> So, I'm a total newbie in Django, and I'm using this tutorial:
> http://www.programmersbook.com/page/21/Django-Beginner-Tutorial-Part-I/. I
> got stuck at the 7.th step.
>
> My error is this(I'm a xubuntu user):
> Traceback (most recent call last):
> File "manage.py", line 10, in <module>
> execute_from_command_line(sys.argv)
> File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 443, in execute_from_command_line
> utility.execute()
> File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
> File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
> File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
> File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
> File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py",
> line 57, in handle_noargs
> cursor = connection.cursor()
> File
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py",
> line 306, in cursor
> cursor = self.make_debug_cursor(self._cursor())
> File
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py",
> line 177, in _cursor
> self.connection = Database.connect(**conn_params)
> File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179,
> in connect
> connection_factory=connection_factory, async=async)
> psycopg2.OperationalError: FATAL: Peer authentication failed for user
> "test"
>
http://www.postgresql.org/docs/9.1/static/auth-methods.html
"""
19.3.6. Ident Authentication
The ident authentication method works by obtaining the client's
operating system user name from an ident server and using it as the
allowed database user name (with an optional user name mapping). This is
only supported on TCP/IP connections.
Note: When ident is specified for a local (non-TCP/IP) connection,
peer authentication (see Section 19.3.7) will be used instead.
The following configuration options are supported for ident:
"""
and
"""
19.3.7. Peer Authentication
The peer authentication method works by obtaining the client's operating
system user name from the kernel and using it as the allowed database
user name (with optional user name mapping). This method is only
supported on local connections.
The following configuration options are supported for peer:
map
Allows for mapping between system and database user names. See
Section 19.2 for details.
Peer authentication is only available on operating systems providing the
getpeereid() function, the SO_PEERCRED socket parameter, or similar
mechanisms. Currently that includes Linux, most flavors of BSD including
Mac OS X, and Solaris.
"""
Off-hand, you probably want to configure PostgreSQL to use
"password" authentication on your local connection; make sure you have a
"Django" specific user/password defined in the server; and provide that
user/password in the Django configuration (you may also need to force it
to use TCP/IP rather than a UNIX (local) socket connection.
Right now it appears that your system is configured for "IDENT"
authentication, which if falling through to "peer" authentication by
being a non-TCP/IP (ie; a local) connection.
It may also be that the username being provided to PostgreSQL is not
defined (it is listing a "test")... perhaps
http://www.postgresql.org/docs/9.1/static/auth-username-maps.html is
applicable?
We'd probably need to see both the PostgreSQL configuration file
along with the Django database configuration...
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment