Getting InspectDB to work with postgres

13 views
Skip to first unread message

Kyle Wan

unread,
Feb 27, 2023, 4:02:35 PM2/27/23
to Django users
Hi,

I'm new to Django, and I'm struggling to get inspectdb to populate postgres models as json, hstore, or array objects. I have put `django.contrib.postgres` under the INSTALLED_APPS and I have psycopg2 installed. I have set my engine to be postgresql and am able to use the makemigration and migrate CLI.

Do I need to do anything extra to get this working? I know inspectdb may not work because it is guessing, but it seems like this is a solved issue in terms of json, hstore, and array for postgres as many people have asked about this issue years past. I am using version 4.1.7 of django.

I'm trying to make an automated script for creating the migration with inspectdb -> makemigration -> migrate, but there is no easy way for detecting what type the inspectdb guessed as TextField.

Thanks!
Reply all
Reply to author
Forward
0 new messages