1

Receiving this running Django on Win7. Friend set up django & database and says all the information in the settings.py is correct but I keep receiving this error when I try to test locally. The other weird thing is when I remove the .sql file from the project directory completely I still receive the same error.

File "c:\python26\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 98, in _cursor
    self.connection = Database.connect(**conn_params)

OperationalError: FATAL:  password authentication failed for user "post_user"

Settings.py:

DATABASE_ENGINE = 'postgresql_psycopg2'    
DATABASE_NAME = 'pinax'       
DATABASE_USER = 'post_user'             
DATABASE_PASSWORD = 'pass'        
DATABASE_HOST = 'localhost'             
DATABASE_PORT = ''     

Thoughts?

3
  • 1
    So, if you try to connect with those parameters with psql what happens? Commented Dec 17, 2010 at 3:06
  • When accessing a Django URL, I receive the "OperationalError" message, as posted above. Commented Dec 17, 2010 at 5:52
  • What has an sql file got to do with it? That's just a random file containing sql commands, not the actual database. As Scott asks, what happens when you try to connect directly to psql - forget about Django for the moment. Commented Dec 17, 2010 at 8:43

2 Answers 2

3

I had the same problem on OSX. I used pgAdminIII to create my database user and it helpfully filled in the "Account expires" field for me... to 1969. Setting this to a future date fixed the problem. In console you can also use a sql command like:

ALTER ROLE username VALID UNTIL 'infinity';
Sign up to request clarification or add additional context in comments.

Comments

1

leave the "Host" info blank (blank defaults to localhost), and also double check the database connection first (tools -> data sources, right click your database, click 'data source properties', and at the bottom of the window that pops up click 'test connection'). You may have to manually change the driver (unlikely) or specify the language (also unlikely), those can both be done in the window where you check the connection.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.