Closed jeancochrane closed 3 years ago
Also: We need to adjust ENGINE
when PostGIS is set. See: https://github.com/datamade/california-dream-index/commit/6f040cc276eef98eb04150eabf2233cc582d6cdd
If you're using dj_database_url
, you can pass the engine when you parse the database object from a connection string, e.g., https://github.com/datamade/la-metro-dashboard/blob/f296ea2b74d0c3cb02d89cbff578debb82e369b3/configs/connection_settings.py#L10-L16!
That's a much better solution, thanks Hannah!
Documentation request
When the
postgis
variable is set toTrue
, thenew-django-app
Cookiecutter template will produce the wrong value forDATABASE_URL
:https://github.com/datamade/how-to/blob/d95e49a220feca259b98e3be44266f554f0b67d8/docker/templates/new-django-app/%7B%7Bcookiecutter.app_name%7D%7D/%7B%7Bcookiecutter.module_name%7D%7D/settings.py#L93
The database connection string should have the
postgis:
prefix, otherwise any migrations that use a GeoDjango field will fail with the following error: