]> wagnertech.de Git - projects.git/blobdiff - debian/mdjango.postinst
webssh added
[projects.git] / debian / mdjango.postinst
diff --git a/debian/mdjango.postinst b/debian/mdjango.postinst
new file mode 100755 (executable)
index 0000000..ff4893d
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -e
+
+a2ensite mysite
+systemctl reload apache2
+
+# check addition to settings
+if ! grep "### MDJANGO ###" /opt/mysite/mysite/settings.py >/dev/null
+then
+       echo "add mdjango settings to settings.py"
+       cat << EOF >> /opt/mysite/mysite/settings.py
+### MDJANGO ###
+DATABASES = {
+    'default': {},
+    'tbd': {
+        'ENGINE': 'django.db.backends.postgresql',
+        'NAME': 'mydatabase',
+        'USER': 'myuser',
+        'PASSWORD': 'mypassword',
+        'HOST': 'localhost',
+        'PORT': '5432',
+    }
+}
+DEBUG = False
+### MDJANGO-END ###
+EOF
+fi