Need help

823 visualizações
Pular para a primeira mensagem não lida

treva...@gmail.com

não lida,
28 de mai. de 2009, 18:31:5128/05/2009
para Django users
I'm new in django and just installed django 1.0.2. Everything works
fine until i use the following command in the terminal

root@tafin-desktop:/home/tafin/mysite# python manage.py syncdb

The following error occurred

Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 340, in execute_manager
utility.execute()
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 295, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 192, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 219, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 348, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
commands/syncdb.py", line 51, in handle_noargs
cursor = connection.cursor()
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
__init__.py", line 56, in cursor
cursor = self._cursor(settings)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
postgresql_psycopg2/base.py", line 84, in _cursor
self.connection = Database.connect(conn_string, **self.options)
psycopg2.OperationalError: FATAL: Ident authentication failed for
user "djangouser"









What should i do to fix the error?
Plz. help me.


Tim Chase

não lida,
28 de mai. de 2009, 19:55:4428/05/2009
para django...@googlegroups.com
> File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
> postgresql_psycopg2/base.py", line 84, in _cursor
> self.connection = Database.connect(conn_string, **self.options)
> psycopg2.OperationalError: FATAL: Ident authentication failed for
> user "djangouser"

Sounds like your postgres database doesn't have a user named
"djangouser", or if so, you put the wrong password in the
settings.py file

-tkc


mizan rahman

não lida,
31 de mai. de 2009, 04:47:3431/05/2009
para django...@googlegroups.com
No, i've checked that i've created a user named "djangouser" and the
problem still exist what will i do? Plz help me

Regards,
Mizan

Skylar Saveland

não lida,
31 de mai. de 2009, 05:24:1931/05/2009
para Django users
skylar@ABC255:/$ sudo updatedb
[sudo] password for skylar:
skylar@ABC255:/$ locate pg_hba.conf
/etc/postgresql/8.3/main/pg_hba.conf
skylar@ABC255:/$ sudo vim /etc/postgresql/8.3/main/pg_hba.conf

There should be some lines something like this (for local access):
local all postgres ident sameuser
local all skylar ident sameuser
local geoDjango geoUser md5
local geoPinax geoUser md5
local yourDB yourUser md5

I rather like these instructions:
http://www.punteney.com/writes/setting-django-slicehost-ubuntu-hardy-postgres-apa/

On May 31, 4:47 am, mizan rahman <trevath...@gmail.com> wrote:
> No, i've checked that i've created a user named "djangouser" and the
> problem still exist what will i do? Plz help me
>
> Regards,
> Mizan
>

Tim Chase

não lida,
31 de mai. de 2009, 07:14:4331/05/2009
para django...@googlegroups.com
mizan rahman wrote:
> No, i've checked that i've created a user named "djangouser" and the
> problem still exist what will i do? Plz help me

and you've checked that the password in settings.py is correct?
You only confirmed one of the two problems I suggested.

If both are correct, you may have to include the section of your
pg_hba.conf that defines access permissions. It usually looks
something like

##############################################################


local all postgres ident sameuser

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
##############################################################

along with information about how your connecting in Django (to
localhost, to the local machine by IP address, to a remote
machine, etc)

-tkc

amy

não lida,
25 de jun. de 2009, 14:48:3225/06/2009
para Django users
I had this same problem...the user and pass were fine but no users
could authenticate on any DB, regardless of settings.

Turns out my issue was only that I needed to add the string
"localhost" to the host parameter.

It's odd since the comments specifically state to leave it blank for
localhost...but oh well. It worked.

DATABASE_HOST = 'localhost' # Set to empty string for
localhost. Not used with sqlite3.

Odd.

thongor

não lida,
3 de abr. de 2012, 11:25:0103/04/2012
para django...@googlegroups.com
Wow this post is really old but this also solved my problem strangely enough.

Andre Terra

não lida,
3 de abr. de 2012, 13:16:3903/04/2012
para django...@googlegroups.com
It could be a regression bug.

To be honest, I don't see a reason why '' should become 'localhost' automagically. I'd much prefer if users were forced to write 'localhost' rather than having Django do it (and fail) for them.

Explicit is better than implicit.

If you haven't yet, please file a bug report: https://code.djangoproject.com/newticket


Cheers,
AT


--
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/-/BI0mwz_xsrsJ.
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.

Peter of the Norse

não lida,
2 de mai. de 2012, 21:52:0602/05/2012
para django...@googlegroups.com
There is a difference between 'localhost' and the empty string. 'localhost' translates into 127.0.0.1 and is sent using the internet. The empty string means to use local sockets for communication. At least with PostgreSQL. (It might be different with MySQL.) 

In short, this is not a bug. Please don't treat it as such, and learn the connection settings of your database.
Peter of the Norse



Kurtis Mullins

não lida,
3 de mai. de 2012, 15:22:4003/05/2012
para django...@googlegroups.com
Your Database may very well be setup to Authenticate the Accessing User on 127.0.0.1 and not 'localhost' (or vice-versa). This would be setup in the database when setting credentials for a user, in the case with MySQL.
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem