summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYulqen <246857+yulqen@users.noreply.github.com>2024-06-07 10:20:55 +0100
committerGitHub <noreply@github.com>2024-06-07 10:20:55 +0100
commitdad618d6c7fd27db276c404fd2f7a3e1ede96cc0 (patch)
treec8fc483b0b0e616dd64ba145ec45a36e589c384b
parent29d93f1869fe09d97246c165502331e547f4327d (diff)
parent76849342a720ea72e1afae6040445582dea3ae51 (diff)
Merge pull request #98 from defencedigital/postgres-migration
Postgres migration
-rw-r--r--.gitignore4
-rw-r--r--conf/settings/base.py1
-rw-r--r--conf/settings/local.py19
-rw-r--r--conf/settings/prod.py5
-rw-r--r--db.sqlite3bin393216 -> 0 bytes
-rw-r--r--poetry.toml2
6 files changed, 21 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index b43bab3..3335a5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,4 +18,6 @@
Staticfile.auth
# Ignore VSCode files
-*.code-workspace \ No newline at end of file
+*.code-workspace
+
+db.sqlite3
diff --git a/conf/settings/base.py b/conf/settings/base.py
index 0d7078a..ce622eb 100644
--- a/conf/settings/base.py
+++ b/conf/settings/base.py
@@ -65,7 +65,6 @@ INTERNAL_IPS = ["127.0.0.1", "localhost"]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
- "whitenoise.middleware.WhiteNoiseMiddleware",
# "debug_toolbar.middleware.DebugToolbarMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
diff --git a/conf/settings/local.py b/conf/settings/local.py
index 0992726..fc42701 100644
--- a/conf/settings/local.py
+++ b/conf/settings/local.py
@@ -1,12 +1,19 @@
from .base import *
+# DATABASES = {
+# "default": {
+# "ENGINE": "django.db.backends.postgresql",
+# "NAME": "ded",
+# "USER": "ded",
+# "PASSWORD": "ded",
+# "HOST": "postgres",
+# "PORT": 5432,
+# }
+# }
+
DATABASES = {
"default": {
- "ENGINE": "django.db.backends.postgresql",
- "NAME": "ded",
- "USER": "ded",
- "PASSWORD": "ded",
- "HOST": "postgres",
- "PORT": 5432,
+ "ENGINE": "django.db.backends.sqlite3",
+ "NAME": "db.sqlite3",
}
}
diff --git a/conf/settings/prod.py b/conf/settings/prod.py
index 5b31337..3a3ada2 100644
--- a/conf/settings/prod.py
+++ b/conf/settings/prod.py
@@ -1,6 +1,7 @@
import os
from .base import *
+from .base import MIDDLEWARE
# Check if running in OpenShift cluster
if os.path.exists("/etc/secret-volume"):
@@ -31,4 +32,8 @@ DATABASES = {
}
}
+# this middleware entry must be in the correct position in the list
+# https://whitenoise.readthedocs.io/en/latest/#quickstart-for-django-apps
+MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware")
+
STATIC_ROOT = "/app/static"
diff --git a/db.sqlite3 b/db.sqlite3
deleted file mode 100644
index 27a9666..0000000
--- a/db.sqlite3
+++ /dev/null
Binary files differ
diff --git a/poetry.toml b/poetry.toml
deleted file mode 100644
index ab1033b..0000000
--- a/poetry.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[virtualenvs]
-in-project = true