]> git.ozlabs.org Git - patchwork/blob - apps/settings.py
f56da70ea02b871ce84dc816283c430cbf3a3328
[patchwork] / apps / settings.py
1 # Django settings for patchwork project.
2 import os
3
4 DEBUG = True
5 TEMPLATE_DEBUG = DEBUG
6
7 ADMINS = (
8      ('Jeremy Kerr', 'jk@ozlabs.org'),
9 )
10
11 MANAGERS = ADMINS
12
13 DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
14 DATABASE_NAME = 'patchwork'             # Or path to database file if using sqlite3.
15 DATABASE_USER = ''             # Not used with sqlite3.
16 DATABASE_PASSWORD = ''         # Not used with sqlite3.
17 DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
18 DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
19
20 # Local time zone for this installation. Choices can be found here:
21 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
22 # although not all variations may be possible on all operating systems.
23 # If running in a Windows environment this must be set to the same as your
24 # system time zone.
25 TIME_ZONE = 'Australia/Canberra'
26
27 # Language code for this installation. All choices can be found here:
28 # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
29 # http://blogs.law.harvard.edu/tech/stories/storyReader$15
30 LANGUAGE_CODE = 'en-au'
31
32 SITE_ID = 1
33
34 # If you set this to False, Django will make some optimizations so as not
35 # to load the internationalization machinery.
36 USE_I18N = True
37
38 # URL that handles the media served from MEDIA_ROOT.
39 # Example: "http://media.lawrence.com"
40 MEDIA_URL = ''
41
42 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
43 # trailing slash.
44 # Examples: "http://foo.com/media/", "/media/".
45 ADMIN_MEDIA_PREFIX = '/media/'
46
47 # Make this unique, and don't share it with anybody.
48 SECRET_KEY = '00000000000000000000000000000000000000000000000000'
49
50 # List of callables that know how to import templates from various sources.
51 TEMPLATE_LOADERS = (
52     'django.template.loaders.filesystem.load_template_source',
53     'django.template.loaders.app_directories.load_template_source',
54 #     'django.template.loaders.eggs.load_template_source',
55 )
56
57 MIDDLEWARE_CLASSES = (
58     'django.middleware.common.CommonMiddleware',
59     'django.contrib.sessions.middleware.SessionMiddleware',
60     'django.contrib.auth.middleware.AuthenticationMiddleware',
61     'django.middleware.doc.XViewMiddleware',
62     'django.middleware.csrf.CsrfViewMiddleware',
63 )
64
65 ROOT_URLCONF = 'apps.urls'
66
67 LOGIN_URL = '/accounts/login'
68 LOGIN_REDIRECT_URL = '/user/'
69
70 # If you change the ROOT_DIR setting in your local_settings.py, you'll need to
71 # re-define the variables that use this (MEDIA_ROOT and TEMPLATE_DIRS) too.
72 ROOT_DIR = '/srv/patchwork'
73 TEMPLATE_DIRS = (
74     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
75     # Always use forward slashes, even on Windows.
76     # Don't forget to use absolute paths, not relative paths.
77     os.path.join(ROOT_DIR, 'templates')
78 )
79 # Absolute path to the directory that holds media.
80 # Example: "/home/media/media.lawrence.com/"
81 MEDIA_ROOT = os.path.join(
82     ROOT_DIR, 'lib', 'python', 'django', 'contrib', 'admin', 'media')
83
84 TEMPLATE_CONTEXT_PROCESSORS = (
85     "django.core.context_processors.auth",
86     "django.core.context_processors.debug",
87     "django.core.context_processors.i18n",
88     "django.core.context_processors.media")
89
90 AUTH_PROFILE_MODULE = "patchwork.userprofile"
91
92 INSTALLED_APPS = (
93     'django.contrib.auth',
94     'django.contrib.contenttypes',
95     'django.contrib.sessions',
96     'django.contrib.sites',
97     'django.contrib.admin',
98     'patchwork',
99     'registration',
100 )
101
102 DEFAULT_PATCHES_PER_PAGE = 100
103 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
104
105 ACCOUNT_ACTIVATION_DAYS = 7
106
107 # Set to True to enable the Patchwork XML-RPC interface
108 ENABLE_XMLRPC = False
109
110 try:
111     from local_settings import *
112 except ImportError, ex:
113     import sys
114     sys.stderr.write(\
115             ("settings.py: error importing local settings file:\n" + \
116             "\t%s\n" + \
117             "Do you have a local_settings.py module?\n") % str(ex))
118     raise