Make modifications to please.py and prod.py to reflect fact that common.py has base definitions for celerybeat tasks
parent
8a0ed638d3
commit
7b4ed8830e
|
@ -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/
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue