Hi,

I use the same name for database user and linux user.

file pg_hba.conf: (unchanged from SuSE default)
{{{
# "local" is for Unix domain socket connections only
local   all         all                               trust
}}}

{{{
# in settings.py
import os
import pwd
USER=pwdtuple[0]
DATABASE_USER = USER
# password, host and port are empty
}}}

This way you need no password since the authentication is done
via unix domain socket and your linux user id.

HTH,
  Thomas

Chirolo schrieb:
> Hello to all.
> I'm a newbie trying to learn Django.
> I'm running Django in a local machine with postgresql_psycop2 database
> in Ubuntu 6.02.
> So far I have been able to set up Django, Postgresql with no problems.
> I was able to create a project name iFriends, a model People, and a
> class Person.
> I also created a databased named iFriendsDB with a user name 'amigo'
> and a password 'test'.
> I had a problem with the authentication first and I went to change the
> file pg_hba.conf
> I change the socket local table field method, first I tried 'md5' and
> it didn't work, then I changed to 'trust' and It worked.
>
> # 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 trust
> # IPv6 local connections:
> host all all ::1/128 trust
>
> But the PROBLEM that I have now is the following message:
> OperationalError: FATAL:  role "amigo" does not exist
>
>
>   
>>>> from iFriends.People.models import Person
>>>> p = Person(name="name", email="email-adress")
>>>> p.save()
>>>>         
>
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "/usr/lib/python2.5/site-packages/django/db/models/base.py",
> line 218, in save
>     cursor = connection.cursor()
>   File "/usr/lib/python2.5/site-packages/django/db/backends/
> __init__.py", line 33, in cursor
>     cursor = self._cursor(settings)
>   File "/usr/lib/python2.5/site-packages/django/db/backends/
> postgresql_psycopg2/base.py", line 69, in _cursor
>     self.connection = Database.connect(conn_string, **self.options)
> OperationalError: FATAL:  role "amigo" does not exist
>
> by the way I changed several times the user name and password and I
> added them to 'settings.py'
>
> Any Ideas what do I need to change.
>
> Thank you.
> Chirolo
> >
>   


-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to