diff --git a/README.md b/README.md index b39cd64e..90a1b6a7 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ to install python-setuptools in step 1: 1. `deactivate ; workon regluit` 1. `django-admin.py syncdb --migrate --noinput` 1. `django-admin.py celeryd --loglevel=INFO` start the celery daemon to perform asynchronous tasks like adding related editions, and display logging information in the foreground.` +1. `django-admin.py celerybeat -l INFO` to start the celerybeat daemon to handle scheduled tasks. 1. `django-admin.py runserver 0.0.0.0:8000` (you can change the port number from the default value of 8000) 1. point your browser at http://localhost:8000/ diff --git a/settings/please.py b/settings/please.py index b3a46f8a..c054d4be 100644 --- a/settings/please.py +++ b/settings/please.py @@ -1,6 +1,4 @@ from regluit.settings.common import * -import regluit -import datetime DEBUG = False TEMPLATE_DEBUG = DEBUG @@ -121,24 +119,6 @@ STATIC_ROOT = '/var/www/static' IS_PREVIEW = False -# periodic tasks for celery -# start out with nothing scheduled -CELERYBEAT_SCHEDULE = {} - -# define some periodic tasks - -SEND_TEST_EMAIL_JOB = { - "task": "regluit.core.tasks.send_mail_task", - "schedule": datetime.timedelta(seconds=30), - "args": ('hi there', 'testing 1, 2, 3', 'raymond.yee@gmail.com', ['raymond.yee@gmail.com']) -} - -EMIT_NOTIFICATIONS_JOB = { - "task": "regluit.core.tasks.emit_notifications", - "schedule": datetime.timedelta(seconds=60), - "args": () -} - # decide which of the period tasks to add to the schedule CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB #CELERYBEAT_SCHEDULE['emit_notifications'] = EMIT_NOTIFICATIONS_JOB diff --git a/settings/prod.py b/settings/prod.py index 8c494d95..05a51a52 100644 --- a/settings/prod.py +++ b/settings/prod.py @@ -1,6 +1,4 @@ from regluit.settings.common import * -import regluit -import datetime DEBUG = False TEMPLATE_DEBUG = DEBUG @@ -120,24 +118,6 @@ LOGGING = { STATIC_ROOT = '/var/www/static' -# periodic tasks for celery -# start out with nothing scheduled -CELERYBEAT_SCHEDULE = {} - -# define some periodic tasks - -SEND_TEST_EMAIL_JOB = { - "task": "regluit.core.tasks.send_mail_task", - "schedule": datetime.timedelta(seconds=30), - "args": ('hi there', 'testing 1, 2, 3', 'raymond.yee@gmail.com', ['raymond.yee@gmail.com']) -} - -EMIT_NOTIFICATIONS_JOB = { - "task": "regluit.core.tasks.emit_notifications", - "schedule": datetime.timedelta(seconds=60), - "args": () -} - # decide which of the period tasks to add to the schedule CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB #CELERYBEAT_SCHEDULE['emit_notifications'] = EMIT_NOTIFICATIONS_JOB