diff --git a/db/project_name/settings/base.py b/db/project_name/settings/base.py index 71df567..443ef76 100644 --- a/db/project_name/settings/base.py +++ b/db/project_name/settings/base.py @@ -34,7 +34,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'django.contrib.gis', + {% if not with_gis %}# {% endif %}'django.contrib.gis', 'rest_framework', 'wq.db.rest', diff --git a/db/project_name/settings/dev.py b/db/project_name/settings/dev.py index 958b81e..c9459d9 100644 --- a/db/project_name/settings/dev.py +++ b/db/project_name/settings/dev.py @@ -19,10 +19,12 @@ DATABASES = { 'default': { - 'ENGINE': 'django.contrib.gis.db.backends.spatialite', - 'NAME': os.path.join(BASE_DIR, 'conf', '{{ project_name }}.sqlite3'), + {% if with_gis %}'ENGINE': 'django.contrib.gis.db.backends.spatialite', + {% else %}'ENGINE': 'django.db.backends.sqlite3', + # To enable GeoDjango: + # 'ENGINE': 'django.contrib.gis.db.backends.spatialite', + {% endif %}'NAME': os.path.join(BASE_DIR, 'conf', '{{ project_name }}.sqlite3'), } } -SPATIALITE_LIBRARY_PATH = 'mod_spatialite' - +{% if not with_gis %}# {% endif %}SPATIALITE_LIBRARY_PATH = 'mod_spatialite' diff --git a/db/project_name/settings/prod.py b/db/project_name/settings/prod.py index 1419afa..e5697f3 100644 --- a/db/project_name/settings/prod.py +++ b/db/project_name/settings/prod.py @@ -18,8 +18,11 @@ DATABASES = { 'default': { - 'ENGINE': 'django.contrib.gis.db.backends.postgis', - 'NAME': '{{ project_name }}', + {% if with_gis %}'ENGINE': 'django.contrib.gis.db.backends.postgis', + {% else %}'ENGINE': 'django.db.backends.postgres', + # To enable GeoDjango: + # 'ENGINE': 'django.contrib.gis.db.backends.postgis', + {% endif %}'NAME': '{{ project_name }}', 'USER': '{{ project_name }}', 'PASSWORD': '', 'HOST': '',