Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't access PostgreSQL databases in Django with normal Ubuntu Linux user
    primarykey
    data
    text
    <p>I am learning to user <code>PostgreSQL</code> and <code>Django</code> together in Ubuntu 11.10, and I have found that I need to switch to the user I created when I installed PostgreSQL (<code>"postgres"</code>) in the Terminal (via <code>"sudo su postgres"</code>) in order to create and then access databases to work with in Django. Unfortunately, the <code>"postgres"</code> user doesn't have file writing privileges on my local file system, so when I try to do certain things like add model objects to the database that have an image field, I'm blocked. But if I switch to my normal Ubuntu user name in the Terminal and try to access my admin site on Django's dev server, I get an error like this:</p> <pre><code>OperationalError at /admin/ 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 </code></pre> <p>I'm trying to read up on the PostgreSQL docs to give my normal user access to the databases I've created for my Django projects, but I can't figure it out because I don't understand the relationship between PostgreSQL roles/users and Ubuntu users. Could someone please explain to me how I can give my normal Ubuntu username access to my databases in PostgreSQL? I will probably need a specific list of instructions as I've tried to piece it together using the PostgreSQL docs and I'm totally lost.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload