Mercurial > public > sg101
comparison gpp/settings/base.py @ 512:3fd369e1197f
Adding in Celery to the settings so we can try to get it running in production.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 11 Dec 2011 21:31:10 +0000 |
parents | 1a09a7bea000 |
children | 9e7ae8462f3f |
comparison
equal
deleted
inserted
replaced
511:5794e3414596 | 512:3fd369e1197f |
---|---|
3 import os | 3 import os |
4 from decimal import Decimal | 4 from decimal import Decimal |
5 | 5 |
6 import django.utils.simplejson as json | 6 import django.utils.simplejson as json |
7 from django.contrib.messages import constants as message_constants | 7 from django.contrib.messages import constants as message_constants |
8 import djcelery | |
9 | |
8 | 10 |
9 PROJECT_PATH = os.path.abspath(os.path.join(os.path.split(__file__)[0], '..')) | 11 PROJECT_PATH = os.path.abspath(os.path.join(os.path.split(__file__)[0], '..')) |
10 | 12 |
11 DEBUG = True | 13 DEBUG = True |
12 TEMPLATE_DEBUG = DEBUG | 14 TEMPLATE_DEBUG = DEBUG |
109 'django.contrib.markup', | 111 'django.contrib.markup', |
110 'django.contrib.messages', | 112 'django.contrib.messages', |
111 'django.contrib.sessions', | 113 'django.contrib.sessions', |
112 'django.contrib.sites', | 114 'django.contrib.sites', |
113 'django.contrib.staticfiles', | 115 'django.contrib.staticfiles', |
116 'djcelery', | |
114 'elsewhere', | 117 'elsewhere', |
115 'tagging', | |
116 'haystack', | 118 'haystack', |
117 'queued_search', | 119 'queued_search', |
120 'tagging', | |
118 'accounts', | 121 'accounts', |
119 'antispam', | 122 'antispam', |
120 'bio', | 123 'bio', |
121 'bulletins', | 124 'bulletins', |
122 'comments', | 125 'comments', |
164 ####################################################################### | 167 ####################################################################### |
165 # Email | 168 # Email |
166 ####################################################################### | 169 ####################################################################### |
167 EMAIL_HOST = 'localhost' | 170 EMAIL_HOST = 'localhost' |
168 EMAIL_PORT = 1025 | 171 EMAIL_PORT = 1025 |
172 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | |
169 | 173 |
170 ####################################################################### | 174 ####################################################################### |
171 # Sessions | 175 # Sessions |
172 ####################################################################### | 176 ####################################################################### |
173 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" | 177 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" |
192 HAYSTACK_SEARCH_ENGINE = 'xapian' | 196 HAYSTACK_SEARCH_ENGINE = 'xapian' |
193 HAYSTACK_XAPIAN_PATH = os.path.join(PROJECT_PATH, 'xapian_index') | 197 HAYSTACK_XAPIAN_PATH = os.path.join(PROJECT_PATH, 'xapian_index') |
194 | 198 |
195 | 199 |
196 ####################################################################### | 200 ####################################################################### |
201 # Celery integration & settings | |
202 ####################################################################### | |
203 BROKER_URL = 'redis://localhost:6379/1' | |
204 BROKER_POOL_LIMIT = 10 | |
205 | |
206 CELERY_IGNORE_RESULT = False | |
207 CELERY_RESULT_BACKEND = 'redis' | |
208 CELERY_REDIS_HOST = 'localhost' | |
209 CELERY_REDIS_PORT = 6379 | |
210 CELERY_REDIS_DB = 1 | |
211 | |
212 CELERY_DISABLE_RATE_LIMITS = True | |
213 CELERY_SEND_TASK_ERROR_EMAILS = True | |
214 | |
215 djcelery.setup_loader() | |
216 | |
217 ####################################################################### | |
197 # GPP Specific Settings | 218 # GPP Specific Settings |
198 ####################################################################### | 219 ####################################################################### |
199 GPP_LOG_LEVEL = 0 | 220 GPP_LOG_LEVEL = 0 |
200 GPP_SEND_EMAIL = False | 221 GPP_SEND_EMAIL = True |
222 MAILER_ENQUEUE_MAIL = True | |
201 GPP_NO_REPLY_EMAIL = 'no_reply' | 223 GPP_NO_REPLY_EMAIL = 'no_reply' |
202 AVATAR_DIR = 'avatars' | 224 AVATAR_DIR = 'avatars' |
203 MAX_AVATAR_SIZE_BYTES = 2 * 1024 * 1024 | 225 MAX_AVATAR_SIZE_BYTES = 2 * 1024 * 1024 |
204 MAX_AVATAR_SIZE_PIXELS = 100 | 226 MAX_AVATAR_SIZE_PIXELS = 100 |
205 AVATAR_DEFAULT_URL = MEDIA_URL + AVATAR_DIR + '/default.png' | 227 AVATAR_DEFAULT_URL = MEDIA_URL + AVATAR_DIR + '/default.png' |
212 DONATIONS_GOAL = Decimal('100.00') # monthly goal | 234 DONATIONS_GOAL = Decimal('100.00') # monthly goal |
213 DONATIONS_ANON_NAME = u'Anonymous' | 235 DONATIONS_ANON_NAME = u'Anonymous' |
214 DONATIONS_ITEM_NUM = '500' # donation w/name listed | 236 DONATIONS_ITEM_NUM = '500' # donation w/name listed |
215 DONATIONS_ITEM_ANON_NUM = '501' # donation listed as anonymous | 237 DONATIONS_ITEM_ANON_NUM = '501' # donation listed as anonymous |
216 | 238 |
217 # If MAILER_ENQUEUE_MAIL is True, all emails will be stored in the | |
218 # mailer application's mail queue (database table). It is then expected | |
219 # that a daemon or cron job will actually send the mail out. If | |
220 # MAILER_ENQUEUE_MAIL is False, then email will only be sent if | |
221 # the setting GPP_SEND_EMAIL (above) is True. In any event, emails | |
222 # will be logged via the Python logger if the Python logger filter | |
223 # DEBUG is active. | |
224 | |
225 MAILER_ENQUEUE_MAIL = True | |
226 | |
227 # Oembed settings | 239 # Oembed settings |
228 OEMBED_MAXWIDTH = 480 | 240 OEMBED_MAXWIDTH = 480 |
229 OEMBED_MAXHEIGHT = 295 | 241 OEMBED_MAXHEIGHT = 295 |
230 | 242 |
231 # GCalendar settings | 243 # GCalendar settings |