· 7 years ago · Mar 16, 2018, 02:08 PM
1# photocircle.conf.base.settings
2
3import os
4
5# ====================
6# = Project Settings =
7# ====================
8
9DOMAIN = 'photocircle.org'
10
11PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
12CVS_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
13
14
15ADMINS = (
16XXXXXXXXXXXXXXXXXXdeletedXXXXXXXXXXXXXX
17)
18
19MANAGERS = ADMINS
20
21INTERNAL_IPS = ('127.0.0.1',)
22
23# =========================
24# = Localization Settings =
25# =========================
26
27TIME_ZONE = 'America/Los_Angeles'
28
29LANGUAGE_CODE = 'en-us'
30
31SITE_ID = 1
32
33USE_I18N = False
34
35
36# =======================
37# = Media File Settings =
38# =======================
39
40
41SITE_MEDIA = os.path.join(CVS_ROOT, "site_media")
42MEDIA_ROOT = os.path.join(SITE_MEDIA, "media")
43STATIC_ROOT = os.path.join(SITE_MEDIA, "static")
44MEDIA_URL = "/site_media/media/"
45STATIC_URL = "/site_media/static/"
46
47STATICFILES_DIRS = (
48 os.path.join(PROJECT_ROOT, "static"),
49)
50
51STATICFILES_FINDERS = (
52 "django.contrib.staticfiles.finders.FileSystemFinder",
53 "django.contrib.staticfiles.finders.AppDirectoriesFinder"
54)
55
56# # =====================
57# = Security Settings =
58# =====================
59
60SECRET_KEY = 'y&zm(yk_z0tp=1n@x@%ie$q4g1v@(mw&*pa%0zr-pfr)&vt4#2'
61
62
63# ================
64# = URL Settings =
65# ================
66
67ROOT_URLCONF = 'photocircle.urls'
68
69
70# =====================
71# = Template Settings =
72# =====================
73
74TEMPLATE_DIRS = [
75 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
76 # Always use forward slashes, even on Windows.
77 # Don't forget to use absolute paths, not relative paths.
78 os.path.join(PROJECT_ROOT, 'templates'),
79 os.path.join(PROJECT_ROOT, 'template_overrides'),
80 os.path.join(PROJECT_ROOT, 'template_overrides/pagination'),
81]
82
83TEMPLATE_CONTEXT_PROCESSORS = [
84 'django.contrib.auth.context_processors.auth',
85 'django.core.context_processors.debug',
86 'django.core.context_processors.i18n',
87 'django.core.context_processors.media',
88 'django.core.context_processors.static',
89 'django.contrib.messages.context_processors.messages',
90 'django.core.context_processors.request',
91]
92
93# ==============
94# = Middleware =
95# ==============
96
97MIDDLEWARE_CLASSES = [
98 'django.middleware.common.CommonMiddleware',
99 'django.contrib.sessions.middleware.SessionMiddleware',
100 'django.middleware.csrf.CsrfViewMiddleware',
101 'django.contrib.auth.middleware.AuthenticationMiddleware',
102 'django.contrib.messages.middleware.MessageMiddleware',
103 'pagination.middleware.PaginationMiddleware',
104]
105
106
107# ==================
108# = Installed Apps =
109# ==================
110
111INSTALLED_APPS = [
112 # Django Contrib Applications
113 'django.contrib.auth',
114 'django.contrib.contenttypes',
115 'django.contrib.sessions',
116 'django.contrib.sites',
117 'django.contrib.messages',
118 'django.contrib.admin',
119 'django.contrib.staticfiles',
120 'django.contrib.humanize',
121 # Third-Party Applications
122 'south',
123 'django_extensions',
124 'registration',
125 'profiles',
126 'imagekit',
127 'pagination',
128 'adminbrowse',
129 # Local Applications
130 'photocircle.apps.recaptcha',
131 'photocircle.apps.policy',
132 'photocircle.apps.profiles',
133 'photocircle.apps.dashboard',
134 'photocircle.apps.accounts',
135 'photocircle.apps.pages',
136 'photocircle.apps.gallery',
137 'photocircle.apps.contests',
138 'photocircle.apps.data_export',
139 'photocircle.apps.simple_ipn',
140 'photocircle.apps.carousel', # from -e git://github.com/bmispelon/django-carousel.git@823cd7e6d98bf44826dcccf81b55b684fa071c84#egg=django_carousel-0.1-py2.6-dev
141]
142
143
144# ==================
145# = Cache Settings =
146# ==================
147
148# CACHE_BACKEND = 'dummy:///'
149#
150# CACHE_MIDDLEWARE_SECONDS = 60 * 5
151# CACHE_MIDDLEWARE_KEY_PREFIX = DOMAIN
152# CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
153
154CACHES = {
155 'default': {
156 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
157 'MIDDLEWARE_SECONDS': 300, # 5 * 60
158 'MIDDLEWARE_KEY_PREFIX': DOMAIN,
159 'MIDDLEWARE_ANONYMOUS_ONLY': True,
160 # 'LOCATION': '127.0.0.1:8000',
161 }
162}
163# ====================
164# = Session Settings =
165# ====================
166
167SESSION_ENGINE = 'django.contrib.sessions.backends.db'
168SESSION_COOKIE_HTTPONLY = True
169
170
171# ==================
172# = Email Settings =
173# ==================
174
175EMAIL_HOST = 'localhost'
176DEFAULT_FROM_EMAIL = 'no-reply@photocircle.org'
177
178
179# =====================
180# = Messages Settings =
181# =====================
182
183MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
184
185# ======================
186# = ReCaptcha Settings =
187# ======================
188
189RECAPTCHA_PUBLIC_KEY = '6LfqdMESAAAAAB5qw9L0bXXzXh7TXgc0ko2UBTB6'
190RECAPTCHA_PRIVATE_KEY = '6LfqdMESAAAAAP2FzfJsi6njFmWPTw0zWj1R5a9u'
191VALIDATE_CAPTCHA = True
192RECAPTCHA_THEME_NAME = 'white'
193
194
195# ====================
196# = Registration =
197# ====================
198
199ACCOUNT_ACTIVATION_DAYS = 2
200
201# LOGIN_REDIRECT_URL controls where a user is redirected after successful login
202# by the contrib.auth.login view. The default value /accounts/profile/
203# is fine if you intend to map a view to that URL, but django-registration
204# doesn't do this for us so we'll just use '/' for now.
205LOGIN_REDIRECT_URL = '/dashboard/'
206
207
208# ====================
209# = Profile Settings =
210# ====================
211
212# The settings value is appname.modelname, and not appname.models.modelname
213# as you might expect. The reason for this is that Django is not doing a
214# direct import, but using an internal model-loading function.
215AUTH_PROFILE_MODULE = "profiles.UserProfile"
216VERIFY_URL_EXISTS = True
217
218
219# ====================
220# = Gallery Settings =
221# ====================
222
223BAD_PHOTO_FORMAT_ERROR_MESSAGE = 'Please upload only photos in JPEG, PNG, GIF, or BMP format.'
224ALLOWED_PHOTO_CONTENT_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp']
225ALLOWED_PHOTO_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
226
227GALLERY_LIMIT = 20
228
229# ========================
230# = Adminbrowse Settings =
231# ========================
232
233ADMINBROWSE_MEDIA_URL = MEDIA_URL + 'adminbrowse/'
234
235
236
237========================
238
239# conf.base.settings_suffix.py
240
241
242try:
243 from local_settings import *
244except ImportError:
245 pass
246
247
248
249
250
251
252
253
254==========================
255
256# photocircle.conf.development.settings
257
258from photocircle.conf.base.settings import *
259
260# ====================
261# = Project Settings =
262# ====================
263
264DOMAIN = 'xxxxxx'
265
266DEBUG = True
267TEMPLATE_DEBUG = DEBUG
268
269
270# ==================
271# = Cache Settings =
272# ==================
273
274CACHES['default']['MIDDLEWARE_KEY_PREFIX'] = DOMAIN
275
276
277# ==========================
278# = Debug Toolbar Settings =
279# ==========================
280
281DEBUG_TOOLBAR = True
282
283if DEBUG_TOOLBAR:
284 MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
285 INSTALLED_APPS.append('debug_toolbar')
286 DEBUG_TOOLBAR_CONFIG = {
287 'INTERCEPT_REDIRECTS': False,
288 }
289
290# ====================
291# = Gondor Settings =
292# ====================
293#
294from photocircle.conf.base.settings_suffix import *