Postgis / Geodjango: Cannot determine PostGIS version for database

后端 未结 5 1759
天涯浪人
天涯浪人 2021-02-01 16:32

I\'m attempting to launch a GeoDjango app. I\'ve installed Postgres & PostGIS using brew on Lion. I created a database using template_postgis: createdb -T template_pos

5条回答
  •  时光取名叫无心
    2021-02-01 17:07

    The solution for me was to run the following in the postgres terminal:

    psql database_name
    
    database_name=# CREATE EXTENSION postgis;
    

    If you get ERROR: relation "spatial_ref_sys" already exists, run the following before CREATE EXTENSION postgis:

     drop table spatial_ref_sys;
     drop table geometry_columns;
    

提交回复
热议问题