diff --git a/Makefile b/Makefile index 06da943c0f..b206e2ba87 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/lib/main/tasks.py b/lib/main/tasks.py new file mode 100644 index 0000000000..e1118061e7 --- /dev/null +++ b/lib/main/tasks.py @@ -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! diff --git a/lib/settings/defaults.py b/lib/settings/defaults.py index c987d8d940..2e4ddff169 100644 --- a/lib/settings/defaults.py +++ b/lib/settings/defaults.py @@ -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 diff --git a/lib/templates/admin/base_site.html b/lib/templates/admin/base_site.html index ca7a6808ad..f8c2d68f48 100644 --- a/lib/templates/admin/base_site.html +++ b/lib/templates/admin/base_site.html @@ -34,6 +34,7 @@ body color: white !important; } .module h2, +.module h2 a, #content-related .module h2, .module caption, .inline-group h2,