Skip to content

Instantly share code, notes, and snippets.

@mmmcorpsvit
Created September 4, 2020 03:40
Show Gist options
  • Save mmmcorpsvit/3614e2396f94fb7bdc555e3b61ec6202 to your computer and use it in GitHub Desktop.
Save mmmcorpsvit/3614e2396f94fb7bdc555e3b61ec6202 to your computer and use it in GitHub Desktop.
Cookiecutter Django, use Postgres + PostGis
You can easy add PostGis following few simple steps:
1. add to `compose\production\django` samewhere in `RUN apt-get update \`
```bash
&& apt-get install -y gdal-bin \
```
2. edit `compose\production\postgres`
change
`FROM postgres:12.3`
to
`FROM postgis/postgis:12-3.0`
3. add to files: `config\settings\base.py` and `config\settings\production.py`
`DATABASES["default"]["ENGINE"] = 'django.contrib.gis.db.backends.postgis'`
P.S.
Tested on https://github.com/pydanny/cookiecutter-django v.3.0.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment