Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Aug 13, 2010 2:23 pm 
Offline
Newbie

Joined: Thu Aug 05, 2010 2:22 pm
Posts: 4
First, I'm a linux noob. So if I've missed something basic, please let me know.

I'd like to check my steps for creating a user for postgres and then allowing that user to authenticate form django to postgres and do teh database work.

SU to postgres. $ su - postgres
As postgres, create a database. $ createdb dbname
As postgres, login to dbname. $ psql -d dbname -U postgres
Create the DB user: $ CREATE USER awesome PASSWORD 'something';
Using CREATE USER assigns login to that user.

That all works. But the only way to actually authenticate to the database is to su to that user.

Now, I add that user, database and password to my Django settings.py file. But when I try to syncdb, I get:

Ident authentication failed for user "awesome"

In my stack trace.

I'm confused what I'm missing. Any suggestions would be welcome. DO I have to set up authentication on my server with postgres?

Dave


Top
   
 Post subject:
PostPosted: Fri Aug 13, 2010 3:40 pm 
Offline
Senior Member

Joined: Tue Feb 19, 2008 10:55 am
Posts: 164
it's been a long time since I used postreg (unfortunately), but I believe you have to do two things.

One, you created the database as the user postgres, owned by postres, rather than as your awesome user, so you'll need to use the grant sql command to give rights to the awesome user.

What i used to do was use the createuser command, then createdb command with a switch to say create the db as user (eg) awesome.

Two, you probably need to look at a file called pg_hba.something (pg_hba.conf?) hiding somewhere in /etc. try

find /etc/ -name pg_hba.*


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group