diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-05-13 22:55:25 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-05-13 23:50:51 +0200 |
commit | 934c181542690ec9053a5a3fb08dd4ac2605051f (patch) | |
tree | 7b3424560df60e2668faaa115a90834a9f486642 /patchwork/production.py | |
parent | aa1ccdabb70427df437f83d88dcbbcff4fa73f88 (diff) |
dockerfile for patchwork patch tracking software
Change-Id: I4095148d2c8a1b6ba9beafda053c38022b147819
Diffstat (limited to 'patchwork/production.py')
-rw-r--r-- | patchwork/production.py | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/patchwork/production.py b/patchwork/production.py new file mode 100644 index 0000000..587c39a --- /dev/null +++ b/patchwork/production.py @@ -0,0 +1,82 @@ +""" +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 __future__ import absolute_import + +import os + +import django + +from .base import * # noqa + +# +# Core settings +# https://docs.djangoproject.com/en/1.8/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 = os.environ['DJANGO_SECRET_KEY'] + +# Email +# +# Replace this with your own details + +EMAIL_HOST = os.getenv('EMAIL_HOST', 'localhost') +EMAIL_PORT = os.getenv('EMAIL_PORT', 25) +EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER', '') +EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD', '') +EMAIL_USE_TLS = True + +DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@lists.osmocom.org>' +SERVER_EMAIL = DEFAULT_FROM_EMAIL +NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL + +ADMINS = ( + ('Holger Freyther', 'holger@freyther.de'), + ('Holger Freyther', 'holger+p@freyther.de'), +) + +# 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.8/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': os.environ.get('DATABASE_NAME', ''), + 'USER': os.environ.get('DATABASE_USER', ''), + 'PASSWORD': os.environ.get('DATABASE_PASSWORD', ''), + 'HOST': os.environ.get('DATABASE_HOST', ''), + 'PORT': os.environ.get('DATABASE_PORT', ''), + }, +} + +# +# Static files settings +# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files +# https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#manifeststaticfilesstorage +# + +STATIC_ROOT = os.environ.get('STATIC_ROOT', '/var/www/patchwork') + +if django.VERSION >= (1, 7): + STATICFILES_STORAGE = \ + 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' + +ALLOWED_HOSTS = ['*'] |