Skip to content

Commit a09f222

Browse files
committed
little things.
1 parent a60b2c1 commit a09f222

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
*.db
66
proj/*.log
77
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

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Starting tasks in the background with `celery multi`: http://docs.celeryproject.org/en/master/getting-started/next-steps.html?highlight=multi#in-the-background
1010
- `celery multi start w1 -A proj -l info`
1111
- Starting a process locally in the terminal: `celery -A proj worker -l info`
12+
- Starting event camera: `celery events --camera=djcelery.snapshot.Camera`
1213

1314
_ _ _
1415

celerybeat-schedule

12 KB
Binary file not shown.

proj/settings.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,31 @@
44
# becomes `proj.celery.schedules` in Python 2.x since it allows
55
# for relative imports by default.
66

7+
import os
8+
79
# Celery settings
810
import djcelery
911
djcelery.setup_loader()
1012

1113
# http://fearofcode.github.io/blog/2013/01/15/how-to-scrub-sensitive-information-from-django-settings-dot-py-files/
1214
from proj.settings_secret import *
1315

16+
# c9IP = os.environ.get('IP')
17+
# BROKER_URL = 'amqp://guest:guest@{}//'.format(c9IP)
1418
# 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
1624

1725
#: Only add pickle to this list if your broker is secured
1826
#: from unwanted access (see userguide/security.html)
1927
CELERY_ACCEPT_CONTENT = ['json']
2028
CELERY_TASK_SERIALIZER = 'json'
2129
CELERY_RESULT_SERIALIZER = 'json'
2230
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
2332

2433
# Django settings for proj project.
2534

proj/settings_secret.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+!'

0 commit comments

Comments
 (0)