Skip to content

Commit

Permalink
Add GROUNDWATER_DATABASE_URL environment
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer committed Jun 13, 2024
1 parent 249da30 commit 6a8f07e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 31 deletions.
3 changes: 2 additions & 1 deletion deployment/.env
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ SFTP_FOLDER=/home/web/statics/sftp/
PYTHONPATH=/home/web/django_project:/geonode
USE_DEFAULT_GEOSERVER_STYLE=False
INITIAL_FIXTURES=True
GROUNDWATER_DATABASE_URL=postgis://geonode:geonode@db:5432/groundwater

VERSION=4.7.1
VERSION=4.8.0
ISTSOS_VERSION=2.4.1-6

# ------ GEOSERVER ------
Expand Down
12 changes: 10 additions & 2 deletions django_project/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,20 @@
]
# -- END Settings for Wagtail

# gwml2 database conf
# -- gwml2 database conf
gwml2_database_conf = copy.copy(DATABASES['default'])
gwml2_database_conf['NAME'] = 'groundwater'

GWML2_DATABASE_CONFIG = 'gwml2'

GROUNDWATER_DATABASE_URL = os.getenv("GROUNDWATER_DATABASE_URL", None)
if GROUNDWATER_DATABASE_URL:
_db_conf = dj_database_url.parse(
GROUNDWATER_DATABASE_URL, conn_max_age=GEONODE_DB_CONN_MAX_AGE
)
gwml2_database_conf.update(_db_conf)
DATABASES[GWML2_DATABASE_CONFIG] = gwml2_database_conf
# --

DATABASE_ROUTERS = ['gwml2.router.GWML2Router']
ROOT_URLCONF = 'core.urls'

Expand Down
27 changes: 0 additions & 27 deletions django_project/core/settings/dev.py
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
from .base import * # noqa

DATABASES = {
'default': {
'NAME': 'geonode',
'USER': 'geonode',
'PASSWORD': 'geonode',
'HOST': 'db',
'PORT': 5432,
'CONN_MAX_AGE': 5,
'ENGINE': 'django.contrib.gis.db.backends.postgis'},
'datastore': {
'NAME': 'geonode_data',
'USER': 'geonode_data',
'PASSWORD': 'geonode',
'HOST': 'db',
'PORT': 5432,
'CONN_MAX_AGE': 5,
'ENGINE': 'django.contrib.gis.db.backends.postgis'},
'gwml2': {
'NAME': 'groundwater',
'USER': 'geonode',
'PASSWORD': 'geonode',
'HOST': 'db',
'PORT': 5432,
'CONN_MAX_AGE': 5,
'ENGINE': 'django.contrib.gis.db.backends.postgis'}
}
2 changes: 1 addition & 1 deletion django_project/version/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.7.1
4.8.0

0 comments on commit 6a8f07e

Please sign in to comment.