Added basic celery support and configuration.

This commit is contained in:
Chris Church 2013-03-14 16:11:14 -04:00
parent da9a31b599
commit a1fb81c4f4
4 changed files with 23 additions and 0 deletions

View File

@ -26,6 +26,10 @@ runserver:
# run for testing the server
python manage.py runserver
celeryd:
# run to start the background celery worker
python manage.py celeryd -l DEBUG -B
# already done and should not have to happen again:
#
#south_init:

7
lib/main/tasks.py Normal file
View File

@ -0,0 +1,7 @@
from celery import task
from lib.main.models import *
@task(name='run_launch_job')
def run_launch_job(launch_job_pk):
launch_job = LaunchJob.objects.get(pk=launch_job_pk)
# FIXME: Do stuff here!

View File

@ -121,6 +121,8 @@ INSTALLED_APPS = (
# 'devserver',
'tastypie',
'django_extensions',
'djcelery',
'kombu.transport.django',
)
INTERNAL_IPS = ('127.0.0.1',)
@ -136,3 +138,12 @@ DEVSERVER_MODULES = (
#'devserver.modules.cache.CacheSummaryModule',
#'devserver.modules.profile.LineProfilerModule',
)
if 'djcelery' in INSTALLED_APPS:
import djcelery
djcelery.setup_loader()
BROKER_URL = 'django://'
CELERY_TRACK_STARTED = True
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
CELERYBEAT_MAX_LOOP_INTERVAL = 60

View File

@ -34,6 +34,7 @@ body
color: white !important;
}
.module h2,
.module h2 a,
#content-related .module h2,
.module caption,
.inline-group h2,