[PATCH 1/2] settings: Add configuration for sqlite DB backend

Stephen Finucane stephen at that.guru
Mon Dec 2 02:05:05 AEDT 2019


Signed-off-by: Stephen Finucane <stephen at that.guru>
---
 patchwork/settings/dev.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index e110e745..c5afe0d5 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -51,6 +51,13 @@ DATABASES = {
 if os.getenv('PW_TEST_DB_TYPE', None) == 'postgres':
     DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
     DATABASES['default']['HOST'] = os.getenv('PW_TEST_DB_HOST', '')
+elif os.getenv('PW_TEST_DB_TYPE', None) == 'sqlite':
+    DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3'
+    DATABASES['default']['NAME'] = '/dev/shm/patchwork.test.db.sqlite3'
+    del DATABASES['default']['HOST']
+    del DATABASES['default']['PORT']
+    del DATABASES['default']['USER']
+    del DATABASES['default']['PASSWORD']
 
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 
-- 
2.23.0



More information about the Patchwork mailing list