Re: What user does django server runs?

780 views
Skip to first unread message
Message has been deleted

Joseph Heck

unread,
Jan 2, 2007, 3:17:08 PM1/2/07
to django...@googlegroups.com
Assuming that you're running this under Apache+Mod_Python (complete guess - please correct me if I'm wrong), the server will be running as whatever Apache is configured to run as. Typically that's not a local username like "saraswati".

If you run Django with a front-end of Lighttpd+FLUP/fgci, then it can easily run under your user account - a fairly common setup on hosted solutions like TextDrive.

-joe

On 1/2/07, Michel Thadeu Sabchuk <mich...@gmail.com> wrote:

Hi guys!

I'm deploying a django project with postgresql as database backend. I
used to create a local user with the same name of the database user
(owner of the database), so I just need to run the webserver as the
local user and the database should work without problems (this was true
for webware). I try to run django as the local user and hit the page
without success, the error message tells me: FATAL: Ident
authentication failed for user "saraswati".

What can I do? Thanks



Jacob M

unread,
Jan 2, 2007, 3:28:52 PM1/2/07
to django...@googlegroups.com
If you're running django under mod_python it will be using whichever
account apache is running under - www-data, apache, etc.

I typically use password-based authentication instead of same-user
ident authentication in postgresql. Look in pg_hba.conf on your
system.

My pg_hba.conf typically looks like this:

local all postgres
ident sameuser
local all all password
host all all 127.0.0.1 255.255.255.255 password

That allows password-based authentication for locally-initiated
connections - either over local unix sockets or tcp connections on the
loopback interface.

Then create a postgresql user and password in psql.

Kenneth Gonsalves

unread,
Jan 2, 2007, 8:54:16 PM1/2/07
to django...@googlegroups.com

On 02-Jan-07, at 11:18 PM, Michel Thadeu Sabchuk wrote:

> without success, the error message tells me: FATAL: Ident
> authentication failed for user "saraswati".

edit pg_hba.conf - change authentication from ident 'sameuser' to
password

--

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/


Kenneth Gonsalves

unread,
Jan 2, 2007, 8:55:23 PM1/2/07
to django...@googlegroups.com

On 03-Jan-07, at 1:58 AM, Jacob M wrote:

> Then create a postgresql user and password in psql.

that is
createuser saraswati -P

Michel Thadeu Sabchuk

unread,
Jan 3, 2007, 12:51:46 PM1/3/07
to Django users
Hi guys!

I'm not very familiar with pg_hba.conf file but with your help I will
:D
Thanks for help!

--
Michel Thadeu Sabchuk
Curitiba/PR

HenrikG

unread,
Jan 27, 2007, 7:16:46 AM1/27/07
to Django users

On 3 Jan, 02:54, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On 02-Jan-07, at 11:18 PM, Michel Thadeu Sabchuk wrote:
>
> > without success, the error message tells me: FATAL:Ident

> > authentication failed for user "saraswati".edit pg_hba.conf - change authentication fromident'sameuser' to


> password
>
> --
>
> regards
> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


I have this same error when i run "python manage.py syncdb".

I tried changing "pg_hba.conf" but without success. I got around the
problem temporarily by running manage.py logged in as user "postgres",
but then I get:

"psycopg2.OperationalError: FATAL: database "sp" does not exist"

At this point, the Apache server isn't running, and it's not needed,
right? So what else can be the problem? I created the database "sp"
with the shell command "createdb" in postgresql and I can access it
through the psql-shell.

lbolo...@gmail.com

unread,
Jan 27, 2007, 8:09:02 AM1/27/07
to Django users
On Jan 2, 6:48 pm, "Michel Thadeu Sabchuk" <miche...@gmail.com> wrote:

> I'm deploying a django project with postgresql as database backend. I
> used to create a local user with the same name of the database user
> (owner of the database), so I just need to run the webserver as the
> local user and the database should work without problems (this was true
> for webware). I try to run django as the local user and hit the page

> without success, the error message tells me: FATAL: Ident
> authentication failed for user "saraswati".

If u're running under Windows you should check out the hidden file at

C:\Documents and Settings\<USERNAME>\Application Data\postgresql
\pgpass.conf

which contains info in the format:

localhost:5432:*:YOUR_USER:YOUR_PASSWORD

Lorenzo

HenrikG

unread,
Jan 31, 2007, 11:17:35 AM1/31/07
to Django users
Well, I solved my connection problems. It seems I had two versions of
PostgreSQL installed and I had created the database with one version
and was running the server with the other version. When I used the
"createdb" command for both versions, one of them said that the
database was corrupt. So I removed the database and recreated it with
the newest PostgreSQL and suddenly everything worked!

I had some problems getting PostgreSQL to work when I installed it, so
I tried several source codes and packages before it worked. That's
probably why I had two different versions.

Reply all
Reply to author
Forward
0 new messages