diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 19569e3..4c36ae9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -52,10 +52,7 @@ jobs:
- name: Migrate
run: poetry run ./manage.py migrate --settings="project.settings.production"
env:
- DJANGO_DATABASE_NAME: ${{ secrets.DJANGO_DATABASE_NAME }}
- DJANGO_DATABASE_USER: ${{ secrets.DJANGO_DATABASE_USER }}
- DJANGO_DATABASE_PASSWORD: ${{ secrets.DJANGO_DATABASE_PASSWORD }}
- DJANGO_DATABASE_HOST: ${{ secrets.DJANGO_DATABASE_HOST }}
+ DATABASE_URL: ${{ secrets.DATABASE_URL }}
DJANGO_SETTINGS_MODULE: project.settings.production
ALLOWED_HOSTS: 127.0.0.1
CSRF_TRUSTED_ORIGINS: http://127.0.0.1
diff --git a/.idea/garden-server.iml b/.idea/garden-server.iml
index d2c509c..e8cd89d 100644
--- a/.idea/garden-server.iml
+++ b/.idea/garden-server.iml
@@ -6,6 +6,7 @@
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 5e21cb5..a4c8cab 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,6 +2,7 @@
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/project/settings/production.py b/project/settings/production.py
index 6e14633..57c3126 100644
--- a/project/settings/production.py
+++ b/project/settings/production.py
@@ -1,3 +1,5 @@
+import dj_database_url
+
from .base import *
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(" ")
@@ -8,16 +10,7 @@
if os.environ.get("DEBUG"):
DEBUG = True
-DATABASES = {
- "default": {
- "ENGINE": "timescale.db.backends.postgis",
- "NAME": os.environ.get("DJANGO_DATABASE_NAME", "gardenserver_django"),
- "USER": os.environ.get("DJANGO_DATABASE_USER"),
- "PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD"),
- "PORT": "5432",
- "HOST": os.environ.get("DJANGO_DATABASE_HOST"),
- },
-}
+DATABASES = {"default": dj_database_url.config()}
# Cache sessions for optimum performance
diff --git a/services/web_service.yaml b/services/web_service.yaml
index dc5ab9b..30e0876 100644
--- a/services/web_service.yaml
+++ b/services/web_service.yaml
@@ -38,26 +38,16 @@ spec:
secretKeyRef:
key: latest
name: DJANGO_SETTINGS_MODULE
- - name: DJANGO_DATABASE_PASSWORD
+ - name: DATABASE_URL
valueFrom:
secretKeyRef:
key: latest
- name: DJANGO_DATABASE_PASSWORD
- - name: DJANGO_DATABASE_HOST
- valueFrom:
- secretKeyRef:
- key: latest
- name: DJANGO_DATABASE_HOST
+ name: DATABASE_URL
- name: DJANGO_SUPERUSER_EMAIL
valueFrom:
secretKeyRef:
key: latest
name: DJANGO_SUPERUSER_EMAIL
- - name: DJANGO_DATABASE_NAME
- valueFrom:
- secretKeyRef:
- key: latest
- name: DJANGO_DATABASE_NAME
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
@@ -78,11 +68,6 @@ spec:
secretKeyRef:
key: latest
name: SECRET_KEY
- - name: DJANGO_DATABASE_USER
- valueFrom:
- secretKeyRef:
- key: latest
- name: DJANGO_DATABASE_USER
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef: