Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 manage.py 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 stackoverflow.com May 1 '11 at 22:32

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

3 Answers 3

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

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

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? –  Erik Kronberg 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 =) –  Erik Kronberg Apr 29 '11 at 15:54

Your Answer


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