]> git.ozlabs.org Git - patchwork/blob - patchwork/settings/base.py
login: Focus the username field on load
[patchwork] / 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)
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 # Testing
54
55 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
56
57 # URLs
58
59 ROOT_URLCONF = 'patchwork.urls'
60
61 # Templates
62
63 TEMPLATE_DIRS = (
64     os.path.join(ROOT_DIR, 'templates'),
65 )
66
67
68 #
69 # Auth settings
70 # https://docs.djangoproject.com/en/1.6/ref/settings/#auth
71 #
72
73 LOGIN_URL = '/user/login/'
74 LOGIN_REDIRECT_URL = '/user/'
75
76
77 #
78 # Sites settings
79 # https://docs.djangoproject.com/en/1.6/ref/settings/#sites
80 #
81
82 SITE_ID = 1
83
84
85 #
86 # Static files settings
87 # https://docs.djangoproject.com/en/1.6/ref/settings/#static-files
88 #
89
90 STATIC_URL = '/static/'
91
92 STATICFILES_DIRS = [
93     os.path.join(ROOT_DIR, 'htdocs'),
94 ]
95
96
97 #
98 # Patchwork settings
99 #
100
101 DEFAULT_PATCHES_PER_PAGE = 100
102 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
103
104 CONFIRMATION_VALIDITY_DAYS = 7
105
106 NOTIFICATION_DELAY_MINUTES = 10
107 NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
108
109 # Set to True to enable the Patchwork XML-RPC interface
110 ENABLE_XMLRPC = False
111
112 # Set to True to enable redirections or URLs from previous versions
113 # of patchwork
114 COMPAT_REDIR = True
115
116 # Set to True to always generate https:// links instead of guessing
117 # the scheme based on current access. This is useful if SSL protocol
118 # is terminated upstream of the server (e.g. at the load balancer)
119 FORCE_HTTPS_LINKS = False