Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Still new in the Linux / django / python / postgres installation.

I have install the latest kubuntu 11.04, installed the postgres and django packages. I have created a django_login in postgres with a database django_db, for django to use.

When I am at the stage to create the base django framework in the database, I have some troubles. It works fine if I type

sudo -u django_login python syncdb

but it doesn't work when I don't use the sudo -u django_login. However, my account is superadmin in postgres and, I have created a system account django_login and my account is part of this group.

what did I miss?

share|improve this question

migrated from May 1 '11 at 22:32

This question came from our site for professional and enthusiast programmers.

You missed that you created the account in PostgreSQL to be used by a system account (ident). If you want an account to use a username and password via the PostgreSQL client library then you need to use one of the other authentication methods.

share|improve this answer

The easier way to let django log in to your Postgresql database is using passwords. Open up your pg_hba.conf file (/etc/postgresql/8.4/main/pg_hba.conf). Change the line

local   all   all   ident


local   all   all   md5

Now Postgresql will let django log in using username and password, instead of requiring the Unix builtin ident system.

share|improve this answer
@stephanef Did you restart Postgresql after changing the conf file? – Johanna Larsson Apr 29 '11 at 14:58
Thanks, (sorry I didn't found a way to insert line breaks...) After restarting the postgres server, it worked just right. I also went further and made the change just for the account. pg_hba.conf has been changed like the following: [local django_db django_login md5]-[local all all ident] Note that the order is important, if all is first then it ignore the django specific handling. – stephanef Apr 29 '11 at 15:20
@stephanef Yeah, that's right. Good job =) – Johanna Larsson Apr 29 '11 at 15:54

Try to specify in the file as the database host. In this way django uses a different authentication method.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.