I'm following the code in the documentation
from django.contrib.postgres.fields import HStoreField
from django.db import models
class Dog(models.Model):
name = models.CharField(max_length=200)
data = HStoreField()
def __str__(self): # __unicode__ on Python 2
return self.name
Running this code results in:
ProgrammingError: can't adapt type 'dict'
I'm using Postgres==9.3.6, psycopg2==2.6, and I've checked that the HStore extension is enabled.
Ensure you add 'django.contrib.postgres'
to settings.INSTALLED_APPS
.
Ensure you add 'django.contrib.postgres' to settings.INSTALLED_APPS.
And the order is important! Put it over the other django.contrib APPS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With