33๐
I had the same problem too: updated osx to 10.7.3 and after I restarted the postgres server I got the same issue when I tried to run $ ./manage.py dbshell
that goes through psycopg2, but didnโt have problem connecting to postgres using psql.
To me the problem appears to be related just to โconnections on Unix domain socketโ, because psycopg2 uses the newly 10.7.3 osx updated postgres library.
I tried to reinstall psycopg2, but nothing was changed.
So, I changed the HOST value on the databases section of my django settings.py, and instead of having an empty string I put 'localhost'
.
and it works perfectly!
8๐
Eelke โs problem was the same as mine.
The quickest fix for this would be to add
export PGHOST=/tmp
an environment variable in your .bashrc/.zshrc/etc
file (depending on which you use).
The best fix would be to set the specific path in your apps config file.
- Upgrading to Django 1.7. Getting error: Cannot serialize: <storages.backends.s3boto.S3BotoStorage object
- Finding a Python Library to Mock a Database
- Django Rest Framework: How to enable swagger docs for function based views
- Django Multi-Table Inheritance VS Specifying Explicit OneToOne Relationship in Models
- Django channels and socket.io-client
4๐
Did a bit of testing on my Mac and I noticed that there are two versions on my system for several commands. One version is in /usr/bin the other is in /Library/PostgreSQL/9.0/bin. The version in /usr/bin is expecting /var/pgsql_socket/.s.PGSQL.5432, the right version for my install expects /tmp/.s.PGSQL.5432
The version in /usr/bin is 9.0.5 and it has been installed by Apple.
Unfortunatly I do not know much about django, but my bet is it is either calling a command in the wrong path or it is loading a library from the wrong location.
- Django: "order" a queryset based on a boolean field
- Disable a specific Django middleware during tests
- How do I use .env in Django?
- How to limit query results with Django Rest filters
2๐
You can fix the problem by creating a symlink:
ln -s /tmp/.s.PGSQL.5432 /var/pgsql_socket/
- Selenium โ python. how to capture network traffic's response
- Can't git-push to heroku due to "Build stream timed out"
2๐
This did the trick for me in the endโฆ
Change the HOST value in the database dictionary in settings.py to this:
โHOSTโ: โ/tmpโ,
Source:
http://jeffammons.net/2011/09/fixing-postgres-on-mac-10-7-tiger-for-django
- Django: authenticating against remote LDAP user โ simple example?
- Django error admin.E033: username is not an attribute of users.CustomUser. Why is my custom user admin not working?
- Django CORS Access-Control-Allow-Origin missing
- How to display "This many months ago" in Django using Humanize?
- Method in Django to display all attributes' values belonging to a created object?
- Django multi-table inheritance, how to know which is the child class of a model?
- Forbidden (403) CSRF verification failed. Request aborted
- Can I create model in Django without automatic ID?
0๐
I ran into the same issue just after upgrading to OSX 10.7.3; reinstalling PostgreSQL solved the problem and did not delete my existing data.
- Returning form errors for AJAX request in Django
- "no such table" error on Heroku after django syncdb passed
- Mix View and ViewSet in a browsable api_root
- Secure static media access in a Django site