Heroku Django post-gis extension: Error "no attribute 'geo_db_type'" problem when migrating a new model that contains geo elements
I'm running into this issue when deploying my django app on heroku. It had be building and deploying fine before I edited my django model to include a geometry field:
geom = models.PointField(verbose_name='geo',srid = 4326)
Now it builds successfully, but then fails at this migration code in the Procfile
`release: python manage.py migrate`
The migration file is successfully in my git repo. And locally I was able to run python manage.py migrate successfully. When I go to migrate on heroku I get the below error.
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
It seems to indicate that there is something "geo-related" missing, but I can't figure out what since I have created a postgis extension on the postgres db in heroku and I have the heroku-geo-buildpack along with the heroku/python buildpack.
On heroku I have python 3.10 and locally it's Python 3.9.13.
In my settings.py file I have:
'ENGINE':'django.contrib.gis.db.backends.postgis', in the DATABASES
and 'django.contrib.gis', in INSTALLED_APPS
Here's the post-gis extension on the heroku postgres database:
And the two buildpacks set in heroku:

Thank you for any help or guidance!
Okay - turns out I had an important couple of lines commented out in my settings.py file. Posting the answer here in case it helps anyone! From my understanding, this part helps make sure the postgis engine is used on the heroku server. But please if anyone knows more about why this helped fix my issue, comment and post, I'm all ears! Thanks!
import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] =
'django.contrib.gis.db.backends.postgis'
DATABASES['default']['NAME'] = os.environ['NAME']
