sudo mkdir -p /etc/paths.d &&
echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "[YOUR_DATABASE_NAME]",
"USER": "[YOUR_USER_NAME]",
"PASSWORD": "",
"HOST": "localhost",
"PORT": "",
}
}
pip install psycopg2
order = ArrayField(models.IntegerField(), default=list)
order = serializers.ListField(
child=serializers.IntegerField(), required=False)
PostgreSQL arrays are enclosed by {}, not []
conn = psycopg2.connect("dbname=name user=username")
cur = conn.cursor()
self.order = cur.mogrify("SELECT %s;", (order, ))
More about psycopg2 usage can be found here