summaryrefslogtreecommitdiff
path: root/patchwork/settings
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2018-09-13 12:13:35 -0600
committerStephen Finucane <stephen@that.guru>2018-10-10 10:17:36 +0100
commitc21990a8d7bfd363fb885879947e794f4a1fa04b (patch)
treead419c57cd61e4f14c5b6f5abbd8e3ed816f1a4d /patchwork/settings
parentae13c6ead782b7ef285c9d35042614e86c221a9c (diff)
downloadpatchwork-c21990a8d7bfd363fb885879947e794f4a1fa04b.tar
patchwork-c21990a8d7bfd363fb885879947e794f4a1fa04b.tar.gz
Add support for 'django-dbbackup'
'parsemail' and 'parsearchive' are slow. When messing with models and migrations, it can be very useful to backup the database in its current state and restore it if/when you mess up. Currently, we've documented how to do this via some commands run in the shell of the container, but we can do things easier via an application designed for this purpose: 'django-dbshell'. Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'patchwork/settings')
-rw-r--r--patchwork/settings/dev.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 4bb5a93..711177c 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -9,6 +9,11 @@ Design based on:
from .base import * # noqa
+try:
+ import dbbackup
+except ImportError:
+ dbbackup = None
+
#
# Core settings
# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
@@ -72,6 +77,14 @@ INTERNAL_IPS = [
'172.18.0.1'
]
+# django-dbbackup
+
+if dbbackup:
+ INSTALLED_APPS += [
+ 'dbbackup',
+ ]
+
+ DBBACKUP_STORAGE_OPTIONS = {'location': '.backups'}
#
# Patchwork settings