blob: 1683c0c54ff0ecc04dc0bbac2137a25c59ff9631 [file] [log] [blame]
Paul Jakma7e43fe42017-03-04 15:09:41 +00001"""
2Sample production-ready settings for patchwork project.
3
4Most of these are commented out as they will be installation dependent.
5
6Design based on:
7 http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
8"""
9
10from __future__ import absolute_import
11
12import os
13
14import django
15
16from .base import * # noqa
17
18DEBUG = True
19#
20# Core settings
21# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
22#
23
24# Security
25#
26# You'll need to replace this to a random string. The following python code can
27# be used to generate a secret key:
28#
29# import string, random
30# chars = string.letters + string.digits + string.punctuation
31# print repr("".join([random.choice(chars) for i in range(0,50)]))
32
33# Email
34#
35# Replace this with your own details
36
37EMAIL_HOST = os.getenv('EMAIL_HOST', 'localhost')
38EMAIL_PORT = os.getenv('EMAIL_PORT', 25)
39EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER', '')
40# password goes in pass.py
41EMAIL_USE_TLS = True
42
43DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.quagga.net>'
44SERVER_EMAIL = DEFAULT_FROM_EMAIL
45NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
46
47ADMINS = (
48 ('Paul Jakma', 'paul@quagga.net'),
49)
50
51# Database
52#
53# If you're using a postgres database, connecting over a local unix-domain
54# socket, then the following setting should work for you. Otherwise,
55# see https://docs.djangoproject.com/en/1.8/ref/settings/#databases
56
57# password goes in pass.py
58DATABASES = {
59 'default': {
60 'ENGINE': 'django.db.backends.mysql',
61 'NAME': os.environ.get('DATABASE_NAME', 'patchwork'),
62 'USER': os.environ.get('DATABASE_USER', 'patchwork'),
63 'HOST': '127.0.0.1',
64 },
65}
66
67
68#
69# Static files settings
70# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files
71# https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#manifeststaticfilesstorage
72#
73
74STATIC_ROOT = os.environ.get('STATIC_ROOT', '/home/patchwork/htdocs/static')
75
76
77if django.VERSION >= (1, 7):
78 STATICFILES_STORAGE = \
79 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
80
81ENABLE_XMLRPC = True
82
83LANGUAGE_CODE='en-gb'
84TIME_ZONE='GMT'
85ALLOWED_HOSTS=['patchwork.quagga.net','testpw.quagga.net', 'http', 'http.quagga.net', '*.quagga.net']
86
87with open("patchwork/settings/pass.py") as f:
88 code = compile(f.read(), "patchwork/settings/pass.py", 'exec')
89 exec(code)