FATAL: Peer authentication failed for user "postgres"
| Request Method: | GET |
|---|---|
| Request URL: | http://127.0.0.1:8000/admin/ |
| Django Version: | 1.3.1 |
| Exception Type: | OperationalError |
| Exception Value: | FATAL: Peer authentication failed for user "postgres" |
| Exception Location: | /usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py in _cursor, line 140 |
| Python Executable: | /usr/bin/python |
| Python Version: | 2.7.2 |
| Python Path: | ['/home/guillaume/moisiedarling', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode'] |
| Server time: | Tue, 17 Apr 2012 01:46:23 -0500 |
I'm not totally sure if this qualifies as a Django question, but it's impeding my ability to make a website with Django so I thought I'd ask here. I'm working with Django in Ubuntu 11.10, where I've set up PostgreSQL to make and manage databases for my Django-powered website. Unfortunately, when working with Django in the Terminal, I need to first switch over to the user "postgres" (the user I created when installing PostgreSQL) in order to do anything with PostgreSQL or its databases. This becomes a problem when I need to simultaneously access my database and the local file system, since my local filesystem is only accessible to my normal Ubuntu Terminal user, "guillaume."
I already have the correct user and passwords entered in my settings.py file for my database, but this doesn't seem to help--I still need to switch over to "posgres" in the Terminal to access my databases. I'm guessing I need to either a) give "guillaume" access to my databases (which I've tried reading up on in the PostgreSQL docs, but am still not sure how to do...part of it is I'm not sure how to tell apart Ubuntu users, Unix users, and Postgres users), or I need to b) give "postgres" access to my local file system. Can anyone tell me which is the better route to follow, and how to achieve it?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/1NWyssjq5sYJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
suitably edit pg_hba.conf
--
regards
Kenneth Gonsalves
--
You received this message because you are subscribed to the Google Groups "Django users" group.
look at the last few lines - change the authentication to 'trust' - this
is ok for a dev machine, later you can study the safer options.
--
regards
Kenneth Gonsalves
look at the last few lines - change the authentication form 'ident' to 'trust' - this
I had to create the file ~/.pgpass in the home directory of my
developers account.
I repeated there the data base name, the user name and the password for
my database.
Example:
localhost:*:db_name:username:password
Afterwards I was able to access the db with
./manage.py dbshell
> <mailto:django...@googlegroups.com>.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com
> <mailto:django-users%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.