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.

On Apr 3, 2012, at 11:16 AM, Andre Terra wrote:

> 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
> 
> 
> On Tue, Apr 3, 2012 at 12:25 PM, thongor <[email protected]> wrote:
> Wow this post is really old but this also solved my problem strangely enough. 
> 
> On Thursday, June 25, 2009 2:48:32 PM UTC-4, amy wrote:
> 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. 
> 
> On May 31, 6:14 am, Tim Chase <[email protected]> wrote: 
> > 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 
> 
> -- 
> 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> 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.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

Peter of the Norse
[email protected]



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to