File tree 5 files changed +22
-2
lines changed
5 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 5
5
* .db
6
6
proj /* .log
7
7
demoapp /* .log
8
- proj /settings_secret.py
8
+
9
+ # a way to hide your django secret key from github see:
10
+ # http://fearofcode.github.io/blog/2013/01/15/how-to-scrub-sensitive-information-from-django-settings-dot-py-files/
11
+ proj /settings_secret.py
Original file line number Diff line number Diff line change 9
9
- Starting tasks in the background with ` celery multi ` : http://docs.celeryproject.org/en/master/getting-started/next-steps.html?highlight=multi#in-the-background
10
10
- ` celery multi start w1 -A proj -l info `
11
11
- Starting a process locally in the terminal: ` celery -A proj worker -l info `
12
+ - Starting event camera: ` celery events --camera=djcelery.snapshot.Camera `
12
13
13
14
_ _ _
14
15
Original file line number Diff line number Diff line change 4
4
# becomes `proj.celery.schedules` in Python 2.x since it allows
5
5
# for relative imports by default.
6
6
7
+ import os
8
+
7
9
# Celery settings
8
10
import djcelery
9
11
djcelery .setup_loader ()
10
12
11
13
# http://fearofcode.github.io/blog/2013/01/15/how-to-scrub-sensitive-information-from-django-settings-dot-py-files/
12
14
from proj .settings_secret import *
13
15
16
+ # c9IP = os.environ.get('IP')
17
+ # BROKER_URL = 'amqp://guest:guest@{}//'.format(c9IP)
14
18
# BROKER_URL = 'amqp://guest:guest@localhost//'
15
- BROKER_URL = 'django://'
19
+ # BROKER_URL = 'django://' # warning: slow, experiemental option
20
+ BROKER_URL = 'redis://localhost:6379/0' # http://docs.celeryproject.org/en/latest/getting-started/brokers/redis.html#results
21
+ BROKER_TRANSPORT_OPTIONS = {'fanout_prefix' : True } # http://docs.celeryproject.org/en/latest/getting-started/brokers/redis.html#caveats
22
+
23
+ BROKER_TRANSPORT_OPTIONS = {'visibility_timeout' : 3600 } # 1 hour for redis: http://docs.celeryproject.org/en/latest/getting-started/brokers/redis.html#visibility-timeout
16
24
17
25
#: Only add pickle to this list if your broker is secured
18
26
#: from unwanted access (see userguide/security.html)
19
27
CELERY_ACCEPT_CONTENT = ['json' ]
20
28
CELERY_TASK_SERIALIZER = 'json'
21
29
CELERY_RESULT_SERIALIZER = 'json'
22
30
CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend' # http://docs.celeryproject.org/en/master/django/first-steps-with-django.html#using-the-django-orm-cache-as-a-result-backend
31
+ CELERY_SEND_EVENTS = True # http://docs.celeryproject.org/en/latest/configuration.html?highlight=events#celery-send-events
23
32
24
33
# Django settings for proj project.
25
34
Original file line number Diff line number Diff line change
1
+ # http://fearofcode.github.io/blog/2013/01/15/how-to-scrub-sensitive-information-from-django-settings-dot-py-files/
2
+ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
3
+ import os
4
+ BASE_DIR = os .path .dirname (os .path .dirname (__file__ ))
5
+
6
+ # SECURITY WARNING: keep the secret key used in production secret!
7
+ SECRET_KEY = 'x2$s&0z2xehpnt_99i8q3)4)t*5q@+n(+6jrqz4@rt%a8fdf+!'
You can’t perform that action at this time.
0 commit comments