Empty string is not the same as typing "localhost" in DATABASE_HOST in settings.py
|Reported by:||crazy2k||Owned by:||nobody|
|Severity:||Normal||Keywords:||postgresql host localhost empty|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I was reading Django's book (http://www.djangobook.com/). At Chapter 5, you start playing a little with the database server. I chose PostgreSQL, and I filled the settings accordingly. However, when I tried:
>>> from django.db import connection >>> cursor = connection.cursor()
(after running python manage.py shell)
I got an error.
I had left the DATABASE_HOST setting blank in settings.py, because it says:
DATABASE_HOST = # Set to empty string for localhost. Not used with sqlite3.
I made it work by explictly adding "localhost" there.
The version of Django I've installed is 1.0-1ubuntu1.
Change History (16)
comment:1 follow-up: 3 Changed 8 years ago by
|Patch needs improvement:||unset|
comment:8 Changed 7 years ago by
|Status:||closed → reopened|
comment:9 Changed 7 years ago by
|Component:||Uncategorized → Documentation|
|Triage Stage:||Unreviewed → Accepted|