bgneal@1
|
1 # Django settings for madeira project.
|
bgneal@1
|
2
|
bgneal@1
|
3 import os
|
bgneal@1
|
4 import platform
|
bgneal@1
|
5 import local_settings
|
bgneal@1
|
6 project_path = os.path.abspath(os.path.split(__file__)[0])
|
bgneal@1
|
7
|
bgneal@1
|
8 DEBUG = local_settings.DEBUG
|
bgneal@1
|
9 TEMPLATE_DEBUG = DEBUG
|
bgneal@1
|
10
|
bgneal@1
|
11 ADMINS = (
|
bgneal@1
|
12 ('Brian Neal', 'admin@surfguitar101.com'),
|
bgneal@1
|
13 )
|
bgneal@1
|
14
|
bgneal@1
|
15 MANAGERS = ADMINS
|
bgneal@1
|
16
|
bgneal@23
|
17 DATABASES = local_settings.DATABASES
|
bgneal@1
|
18
|
bgneal@1
|
19 INTERNAL_IPS = local_settings.INTERNAL_IPS
|
bgneal@1
|
20
|
bgneal@1
|
21 # Local time zone for this installation. Choices can be found here:
|
bgneal@1
|
22 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
bgneal@1
|
23 # although not all choices may be available on all operating systems.
|
bgneal@1
|
24 # If running in a Windows environment this must be set to the same as your
|
bgneal@1
|
25 # system time zone.
|
bgneal@1
|
26 TIME_ZONE = local_settings.TIME_ZONE
|
bgneal@1
|
27
|
bgneal@1
|
28 # Language code for this installation. All choices can be found here:
|
bgneal@1
|
29 # http://www.i18nguy.com/unicode/language-identifiers.html
|
bgneal@1
|
30 LANGUAGE_CODE = 'en-us'
|
bgneal@1
|
31
|
bgneal@1
|
32 SITE_ID = local_settings.SITE_ID
|
bgneal@1
|
33
|
bgneal@1
|
34 # If you set this to False, Django will make some optimizations so as not
|
bgneal@1
|
35 # to load the internationalization machinery.
|
bgneal@1
|
36 USE_I18N = False
|
bgneal@1
|
37
|
bgneal@1
|
38 # Absolute path to the directory that holds media.
|
bgneal@1
|
39 # Example: "/home/media/media.lawrence.com/"
|
bgneal@1
|
40 MEDIA_ROOT = local_settings.MEDIA_ROOT
|
bgneal@1
|
41
|
bgneal@1
|
42 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
bgneal@1
|
43 # trailing slash if there is a path component (optional in other cases).
|
bgneal@1
|
44 # Examples: "http://media.lawrence.com", "http://example.com/media/"
|
bgneal@1
|
45 MEDIA_URL = local_settings.MEDIA_URL
|
bgneal@1
|
46
|
bgneal@1
|
47 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
bgneal@1
|
48 # trailing slash.
|
bgneal@1
|
49 # Examples: "http://foo.com/media/", "/media/".
|
bgneal@1
|
50 ADMIN_MEDIA_PREFIX = local_settings.ADMIN_MEDIA_PREFIX
|
bgneal@1
|
51
|
bgneal@23
|
52 # Staticfiles settings:
|
bgneal@23
|
53 STATICFILES_DIRS = local_settings.STATICFILES_DIRS
|
bgneal@23
|
54 STATIC_ROOT = local_settings.STATIC_ROOT
|
bgneal@23
|
55 STATIC_URL = local_settings.STATIC_URL
|
bgneal@23
|
56
|
bgneal@1
|
57 # Make this unique, and don't share it with anybody.
|
bgneal@1
|
58 SECRET_KEY = local_settings.SECRET_KEY
|
bgneal@1
|
59
|
bgneal@23
|
60 if DEBUG:
|
bgneal@23
|
61 TEMPLATE_LOADERS = (
|
bgneal@23
|
62 'django.template.loaders.filesystem.Loader',
|
bgneal@23
|
63 'django.template.loaders.app_directories.Loader',
|
bgneal@23
|
64 )
|
bgneal@23
|
65 else:
|
bgneal@23
|
66 TEMPLATE_LOADERS = (
|
bgneal@23
|
67 ('django.template.loaders.cached.Loader', (
|
bgneal@23
|
68 'django.template.loaders.filesystem.Loader',
|
bgneal@23
|
69 'django.template.loaders.app_directories.Loader',
|
bgneal@23
|
70 )),
|
bgneal@23
|
71 )
|
bgneal@1
|
72
|
bgneal@23
|
73 if DEBUG:
|
bgneal@23
|
74 MIDDLEWARE_CLASSES = (
|
bgneal@23
|
75 'django.middleware.common.CommonMiddleware',
|
bgneal@23
|
76 'django.middleware.csrf.CsrfViewMiddleware',
|
bgneal@23
|
77 'django.contrib.sessions.middleware.SessionMiddleware',
|
bgneal@23
|
78 'django.contrib.messages.middleware.MessageMiddleware',
|
bgneal@23
|
79 'debug_toolbar.middleware.DebugToolbarMiddleware',
|
bgneal@23
|
80 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
bgneal@23
|
81 'django.middleware.doc.XViewMiddleware',
|
bgneal@23
|
82 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
|
bgneal@23
|
83 )
|
bgneal@23
|
84 else:
|
bgneal@23
|
85 MIDDLEWARE_CLASSES = (
|
bgneal@23
|
86 'django.middleware.common.CommonMiddleware',
|
bgneal@23
|
87 'django.middleware.csrf.CsrfViewMiddleware',
|
bgneal@23
|
88 'django.contrib.sessions.middleware.SessionMiddleware',
|
bgneal@23
|
89 'django.contrib.messages.middleware.MessageMiddleware',
|
bgneal@23
|
90 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
bgneal@23
|
91 'django.middleware.doc.XViewMiddleware',
|
bgneal@23
|
92 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
|
bgneal@23
|
93 )
|
bgneal@1
|
94
|
bgneal@23
|
95 #######################################################################
|
bgneal@23
|
96 # Caching
|
bgneal@23
|
97 #######################################################################
|
bgneal@23
|
98 if local_settings.USE_CACHE:
|
bgneal@23
|
99 CACHES = local_settings.CACHES
|
bgneal@23
|
100 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = local_settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY
|
bgneal@23
|
101 CACHE_MIDDLEWARE_SECONDS = local_settings.CACHE_MIDDLEWARE_SECONDS
|
bgneal@23
|
102 CACHE_MIDDLEWARE_KEY_PREFIX = local_settings.CACHE_MIDDLEWARE_KEY_PREFIX
|
bgneal@1
|
103
|
bgneal@1
|
104 ROOT_URLCONF = 'mysite.urls'
|
bgneal@1
|
105
|
bgneal@1
|
106 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
bgneal@1
|
107 # Always use forward slashes, even on Windows.
|
bgneal@1
|
108 # Don't forget to use absolute paths, not relative paths.
|
bgneal@1
|
109 TEMPLATE_DIRS = (
|
bgneal@1
|
110 os.path.join(project_path, 'templates'),
|
bgneal@1
|
111 os.path.join(project_path, 'templates', 'band'),
|
bgneal@1
|
112 os.path.join(project_path, 'photologue', 'templates'),
|
bgneal@1
|
113 )
|
bgneal@1
|
114
|
bgneal@1
|
115 TEMPLATE_CONTEXT_PROCESSORS = (
|
bgneal@23
|
116 "django.contrib.auth.context_processors.auth",
|
bgneal@23
|
117 "django.core.context_processors.debug",
|
bgneal@23
|
118 "django.core.context_processors.request",
|
bgneal@23
|
119 "django.core.context_processors.media",
|
bgneal@23
|
120 "django.core.context_processors.static",
|
bgneal@23
|
121 "django.contrib.messages.context_processors.messages",
|
bgneal@1
|
122 )
|
bgneal@1
|
123
|
bgneal@23
|
124 INSTALLED_APPS = [
|
bgneal@23
|
125 'django.contrib.admin',
|
bgneal@23
|
126 'django.contrib.admindocs',
|
bgneal@1
|
127 'django.contrib.auth',
|
bgneal@1
|
128 'django.contrib.contenttypes',
|
bgneal@23
|
129 'django.contrib.flatpages',
|
bgneal@23
|
130 'django.contrib.markup',
|
bgneal@23
|
131 'django.contrib.messages',
|
bgneal@1
|
132 'django.contrib.sessions',
|
bgneal@1
|
133 'django.contrib.sites',
|
bgneal@23
|
134 'django.contrib.staticfiles',
|
bgneal@1
|
135 'mysite.band',
|
bgneal@1
|
136 'mysite.photologue',
|
bgneal@23
|
137 ]
|
bgneal@23
|
138 if DEBUG:
|
bgneal@23
|
139 INSTALLED_APPS.append('debug_toolbar')
|
bgneal@23
|
140
|
bgneal@23
|
141 #######################################################################
|
bgneal@23
|
142 # Messages
|
bgneal@23
|
143 #######################################################################
|
bgneal@23
|
144 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
|
bgneal@23
|
145
|
bgneal@23
|
146 #######################################################################
|
bgneal@23
|
147 # Email
|
bgneal@23
|
148 #######################################################################
|
bgneal@23
|
149 EMAIL_HOST = local_settings.EMAIL_HOST
|
bgneal@23
|
150 EMAIL_PORT = local_settings.EMAIL_PORT
|
bgneal@23
|
151
|
bgneal@23
|
152 #######################################################################
|
bgneal@23
|
153 # Sessions
|
bgneal@23
|
154 #######################################################################
|
bgneal@23
|
155 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
|
bgneal@23
|
156 SESSION_COOKIE_AGE = 2 * 7 * 24 * 60 * 60 # 2 weeks in seconds
|
bgneal@23
|
157 SESSION_COOKIE_DOMAIN = None
|
bgneal@23
|
158 SESSION_COOKIE_NAME = 'madeira_sessionid'
|
bgneal@23
|
159 SESSION_COOKIE_PATH = '/'
|
bgneal@23
|
160 SESSION_COOKIE_SECURE = False
|
bgneal@23
|
161 SESSION_EXPIRE_AT_BROWSER_CLOSE = False
|
bgneal@23
|
162 SESSION_SAVE_EVERY_REQUEST = False
|
bgneal@23
|
163
|
bgneal@23
|
164 #######################################################################
|
bgneal@23
|
165 # Configure Logging
|
bgneal@23
|
166 #######################################################################
|
bgneal@23
|
167
|
bgneal@23
|
168 LOGGING = local_settings.LOGGING
|
bgneal@23
|
169
|
bgneal@23
|
170 #######################################################################
|
bgneal@23
|
171 # Django Debug Toolbar
|
bgneal@23
|
172 #######################################################################
|
bgneal@23
|
173
|
bgneal@23
|
174 if DEBUG:
|
bgneal@23
|
175 DEBUG_TOOLBAR_CONFIG = local_settings.DEBUG_TOOLBAR_CONFIG
|
bgneal@23
|
176
|