pythondjango
pythondjango

Reputation: 1681

Postgresql / Django problem. Password not working / Database not being accessed?

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?

Upvotes: 1

Views: 1346

Answers (2)

Marshall
Marshall

Reputation: 197

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';

Upvotes: 3

Choscura
Choscura

Reputation: 11

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.

Upvotes: 1

Related Questions