summaryrefslogtreecommitdiffstats
path: root/patchwork
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-05-24 17:50:33 +0800
committerJeremy Kerr <jk@ozlabs.org>2015-05-28 09:05:37 +0800
commitd636cb34a3b13ea3e6b776e951e6276a94d968c6 (patch)
tree4be54afc3e1a27af17f1e171f57768a0ec4dccba /patchwork
parentcb407f1dddee250eee5664f163868e96ada292c9 (diff)
downloadpatchwork-d636cb34a3b13ea3e6b776e951e6276a94d968c6.tar.bz2
patchwork-d636cb34a3b13ea3e6b776e951e6276a94d968c6.tar.xz
Update documentation and default settings to suit patchwork deployment model
We've always allowed configuration without altering any of the version-controlled files. With the recent settings changes, we have an extra level of indirection with the dev/prod settings modules. Since we have to edit a config file anyway, this change moves the prod.py settings file to a template, which is then used directly by mange.py (and the wsgi application). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'patchwork')
-rw-r--r--patchwork/settings/prod.py62
-rw-r--r--patchwork/settings/production.example.py58
2 files changed, 58 insertions, 62 deletions
diff --git a/patchwork/settings/prod.py b/patchwork/settings/prod.py
deleted file mode 100644
index d71f3df..0000000
--- a/patchwork/settings/prod.py
+++ /dev/null
@@ -1,62 +0,0 @@
-"""
-Sample production-ready settings for patchwork project.
-
-Most of these are commented out as they will be installation dependent.
-
-Design based on:
- http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
-"""
-
-from base import *
-
-#
-# Core settings
-# https://docs.djangoproject.com/en/1.6/ref/settings/#core-settings
-#
-
-# Security
-
-# SECRET_KEY = '00000000000000000000000000000000000000000000000000'
-
-# Email
-
-# ADMINS = (
-# ('Jeremy Kerr', 'jk@ozlabs.org'),
-# )
-
-# Database
-
-# DATABASES = {
-# 'default': {
-# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
-# 'NAME': 'patchwork',
-# },
-# }
-
-# File Uploads
-
-# MEDIA_ROOT = os.path.join(
-# ROOT_DIR, 'lib', 'python', 'django', 'contrib', 'admin', 'media')
-
-
-#
-# Static files settings
-# https://docs.djangoproject.com/en/1.6/ref/settings/#static-files
-#
-
-# STATIC_ROOT = '/srv/patchwork/htdocs'
-
-
-#
-# Custom user overrides (for legacy)
-#
-
-try:
- from local_settings import *
-except ImportError, ex:
- import sys
- sys.stderr.write(\
- ("settings.py: error importing local settings file:\n" + \
- "\t%s\n" + \
- "Do you have a local_settings.py module?\n") % str(ex))
- raise
diff --git a/patchwork/settings/production.example.py b/patchwork/settings/production.example.py
new file mode 100644
index 0000000..fd0a1f6
--- /dev/null
+++ b/patchwork/settings/production.example.py
@@ -0,0 +1,58 @@
+"""
+Sample production-ready settings for patchwork project.
+
+Most of these are commented out as they will be installation dependent.
+
+Design based on:
+ http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
+"""
+
+from base import *
+
+#
+# Core settings
+# https://docs.djangoproject.com/en/1.6/ref/settings/#core-settings
+#
+
+# Security
+#
+# You'll need to replace this to a random string. The following python code can
+# be used to generate a secret key:
+#
+# import string, random
+# chars = string.letters + string.digits + string.punctuation
+# print repr("".join([random.choice(chars) for i in range(0,50)]))
+
+# SECRET_KEY = '00000000000000000000000000000000000000000000000000'
+
+# Email
+#
+# Replace this with your own details
+
+ADMINS = (
+# ('Jeremy Kerr', 'jk@ozlabs.org'),
+)
+
+DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
+NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
+
+# Database
+#
+# If you're using a postgres database, connecting over a local unix-domain
+# socket, then the following setting should work for you. Otherwise,
+# see https://docs.djangoproject.com/en/1.7/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': 'patchwork',
+ },
+}
+
+#
+# Static files settings. Set this to the
+# https://docs.djangoproject.com/en/1.7/ref/settings/#static-files
+#
+
+STATIC_ROOT = '/srv/patchwork/htdocs/static'
+