About Creating Spatial Postgres Database
To use spatial features like distance calculation between points with the Postgres database, you need PostGIS extension. It has to be activated for each Postgres database individually. On MacOS, you can install the database management system and extension with Homebrew:
1 2 3 |
|
Create the user and database for a new project and activate the PostGIS extension with these commands:
1 2 3 4 |
|
Then use "django.contrib.gis.db.backends.postgis"
as the database backend in your Django project settings:
1 2 3 4 5 6 7 8 9 10 |
|
Tips and Tricks Programming Dev Ops Databases Django 5.x Django 4.2 Django 3.2 PostgreSQL PostGIS
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.