]> git.ozlabs.org Git - patchwork/blob - apps/patchwork/settings/base.py
5440de67befb72f97be2f88a080eb1562b2b1704
[patchwork] / apps / patchwork / settings / base.py
1 """
2 Base settings for patchwork project.
3 """
4
5 import os
6
7 import django
8
9 ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
10                         os.pardir, os.pardir, os.pardir)
11
12 #
13 # Core settings
14 # https://docs.djangoproject.com/en/1.6/ref/settings/#core-settings
15 #
16
17 # Models
18
19 INSTALLED_APPS = [
20     'django.contrib.auth',
21     'django.contrib.contenttypes',
22     'django.contrib.sessions',
23     'django.contrib.sites',
24     'django.contrib.admin',
25     'django.contrib.staticfiles',
26     'patchwork',
27 ]
28
29 # HTTP
30
31 MIDDLEWARE_CLASSES = [
32     'django.middleware.common.CommonMiddleware',
33     'django.contrib.sessions.middleware.SessionMiddleware',
34     'django.contrib.auth.middleware.AuthenticationMiddleware',
35     'django.contrib.messages.middleware.MessageMiddleware',
36     'django.middleware.csrf.CsrfViewMiddleware',
37 ]
38
39 if django.VERSION < (1, 7):
40     MIDDLEWARE_CLASSES.append('django.middleware.doc.XViewMiddleware')
41 else:
42     MIDDLEWARE_CLASSES.append(
43         'django.contrib.admindocs.middleware.XViewMiddleware')
44
45 # Globalization
46
47 TIME_ZONE = 'Australia/Canberra'
48
49 LANGUAGE_CODE = 'en-au'
50
51 USE_I18N = True
52
53 # URLs
54
55 ROOT_URLCONF = 'patchwork.urls'
56
57 # Templates
58
59 TEMPLATE_DIRS = (
60     os.path.join(ROOT_DIR, 'templates'),
61 )
62
63
64 #
65 # Auth settings
66 # https://docs.djangoproject.com/en/1.6/ref/settings/#auth
67 #
68
69 LOGIN_URL = '/user/login/'
70 LOGIN_REDIRECT_URL = '/user/'
71
72
73 #
74 # Sites settings
75 # https://docs.djangoproject.com/en/1.6/ref/settings/#sites
76 #
77
78 SITE_ID = 1
79
80
81 #
82 # Static files settings
83 # https://docs.djangoproject.com/en/1.6/ref/settings/#static-files
84 #
85
86 STATIC_URL = '/static/'
87
88 STATICFILES_DIRS = [
89     os.path.join(ROOT_DIR, 'htdocs'),
90 ]
91
92
93 #
94 # Patchwork settings
95 #
96
97 DEFAULT_PATCHES_PER_PAGE = 100
98 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
99
100 CONFIRMATION_VALIDITY_DAYS = 7
101
102 NOTIFICATION_DELAY_MINUTES = 10
103 NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
104
105 # Set to True to enable the Patchwork XML-RPC interface
106 ENABLE_XMLRPC = False
107
108 # Set to True to enable redirections or URLs from previous versions
109 # of patchwork
110 COMPAT_REDIR = True
111
112 # Set to True to always generate https:// links instead of guessing
113 # the scheme based on current access. This is useful if SSL protocol
114 # is terminated upstream of the server (e.g. at the load balancer)
115 FORCE_HTTPS_LINKS = False