heya,

Using "www-data" as the backend database username in settings.py
doesn't quite work. If you try to run a ./manage.py syncdb, it spits
out:

    Traceback (most recent call last):
      File "./manage.py", line 11, in <module>
        execute_manager(settings)
      File "/usr/local/lib/python2.6/dist-packages/django/core/
management/__init__.py", line 438, in execute_manager
        utility.execute()
      File "/usr/local/lib/python2.6/dist-packages/django/core/
management/__init__.py", line 379, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/lib/python2.6/dist-packages/django/core/
management/base.py", line 191, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "/usr/local/lib/python2.6/dist-packages/django/core/
management/base.py", line 220, in execute
        output = self.handle(*args, **options)
      File "/usr/local/lib/python2.6/dist-packages/django/core/
management/base.py", line 351, in handle
        return self.handle_noargs(**options)
      File "/usr/local/lib/python2.6/dist-packages/django/core/
management/commands/syncdb.py", line 52, in handle_noargs
        cursor = connection.cursor()
      File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
__init__.py", line 75, in cursor
        cursor = self._cursor()
      File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
postgresql_psycopg2/base.py", line 136, in _cursor
        self.connection = Database.connect(**conn_params)
    psycopg2.OperationalError: FATAL:  Ident authentication failed for
user "www-data"

I've changed the authentication in my pg_hba.conf from "ident" to
"password", and it now works with "victorhooi" as the backend database
username =). So there's no need to use a PostgreSQL www-data account.

I'm still curious what changed? Perhaps Ubuntu's default pg_hba.conf
file changed from 9.04 to 10.04? AFAIK, there wasn't any such change,
although I don't have a 9.04 system around to verify.

Anyhow, is this the recommended configuration, what I have now? Just
want to know the right way of doing things?

Cheers,
Victor

On Jun 21, 4:54 pm, Torsten Bronger <[email protected]>
wrote:
> Hall chen!
>
> Victor Hooi writes:
> > [...]
>
> > However, I'm still curious as to what changed, as I'm fairly sure
> > this setup worked on the old Ubuntu 9.04 server? And I'm
> > definitely sure that the database username was set to "victorhooi"
> > on that old system - I copied the settings.py file over using
> > verbatim (rsync).
>
> Maybe pg_hba.conf has changed.
>
> > Also, is this recommended practice, to use "www-data" as the
> > backend database username?
>
> No, not recommended, but not forbidden either.  We didn't use
> "ident" but "password" in pg_hba.conf.  This way, you are not bound
> to user accounts of the underlying operating system.
>
> But possibly we switch to "ident" for local connections
> (i.e. command line) and "password" for TCP/IP connections.  The
> reason is that passwords make command line scripting harder.
>
> Tsch ,
> Torsten.
>
> --
> Torsten Bronger, aquisgrana, europa vetus
>                    Jabber ID: [email protected]
>                                   orhttp://bronger-jmp.appspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to