File tree 5 files changed +33
-3
lines changed
5 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ node_modules/
22
22
/develop /playbook.retry
23
23
develop /tools /* .csv
24
24
.vscode /
25
+ celerybeat-schedule
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ version: '3'
2
2
3
3
volumes :
4
4
pgdata :
5
+ redisdata :
5
6
6
7
services :
7
8
db :
@@ -11,16 +12,39 @@ services:
11
12
- " 5432:5432"
12
13
volumes :
13
14
- pgdata:/var/lib/postgresql/data/
15
+ redis :
16
+ image : redis
17
+ restart : always
18
+ ports :
19
+ - " 6379:6379"
20
+ volumes :
21
+ - redisdata:/var/lib/redis/
14
22
web :
15
23
build : .
16
24
command : python manage.py runserver 0.0.0.0:8000
17
25
environment :
18
26
- DB_NAME=postgres
19
27
- DB_USER=postgres
20
28
- DB_HOST=db
29
+ - REDIS_HOST=redis
21
30
volumes :
22
31
- .:/code
23
32
ports :
24
33
- " 8000:8000"
25
34
depends_on :
26
35
- db
36
+ - redis
37
+ worker :
38
+ build : .
39
+ command : celery -A pycon worker --autoreload --beat
40
+ environment :
41
+ - C_FORCE_ROOT=1
42
+ - DB_NAME=postgres
43
+ - DB_USER=postgres
44
+ - DB_HOST=db
45
+ - REDIS_HOST=redis
46
+ volumes :
47
+ - .:/code
48
+ depends_on :
49
+ - db
50
+ - redis
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ def env_or_default(NAME, default):
207
207
"selectable" ,
208
208
"multi_email_field" ,
209
209
"email_log" ,
210
+ "djcelery_email" ,
210
211
211
212
# symposion
212
213
"symposion.conference" ,
@@ -237,7 +238,8 @@ def env_or_default(NAME, default):
237
238
238
239
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
239
240
240
- EMAIL_BACKEND = 'email_log.backends.EmailBackend'
241
+ EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
242
+ CELERY_EMAIL_BACKEND = 'email_log.backends.EmailBackend'
241
243
EMAIL_LOG_BACKEND = "django.core.mail.backends.console.EmailBackend"
242
244
243
245
ACCOUNT_OPEN_SIGNUP = True
@@ -339,7 +341,8 @@ def env_or_default(NAME, default):
339
341
340
342
341
343
# Celery
342
- BROKER_URL = 'redis://localhost:6379/0' # Redis DB 0 for Celery. (Cache will use DB 1)
344
+ REDIS_HOST = os .environ .get ('REDIS_HOST' , 'localhost' )
345
+ BROKER_URL = 'redis://{}:6379/0' .format (REDIS_HOST ) # Redis DB 0 for Celery. (Cache will use DB 1)
343
346
# We deliberately do not set CELERY_RESULT_BACKEND because we are discarding results.
344
347
# Pickle is fine, our redis is only accessible on localhost
345
348
CELERY_ACCEPT_CONTENT = ['pickle' ]
Original file line number Diff line number Diff line change 34
34
MANAGERS = ADMINS
35
35
36
36
# Yes, send email
37
- EMAIL_BACKEND = 'email_log.backends.EmailBackend'
37
+ EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
38
+ CELERY_EMAIL_BACKEND = 'email_log.backends.EmailBackend'
38
39
EMAIL_LOG_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
39
40
EMAIL_HOST = env_or_default ("EMAIL_HOST" , "" )
40
41
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ django-uni-form==0.9.0
29
29
requests==2.0.0
30
30
bleach==1.4
31
31
32
+ django-celery-email==2.0.0
32
33
django-email-log==0.2.0
33
34
django-multi-email-field==0.3.1
34
35
You can’t perform that action at this time.
0 commit comments