Skip to content

Commit

Permalink
make GDAL optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jan 11, 2019
1 parent dd01d47 commit 3fa332a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion db/project_name/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 6 additions & 4 deletions db/project_name/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
7 changes: 5 additions & 2 deletions db/project_name/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': '',
Expand Down

0 comments on commit 3fa332a

Please sign in to comment.