summaryrefslogtreecommitdiff
path: root/online_test/celery.py
diff options
context:
space:
mode:
authoradityacp2020-04-17 16:54:35 +0530
committeradityacp2020-04-17 16:54:35 +0530
commit348f2bc4f727b27abd9878334e886527479d260c (patch)
treeb1652b2c981540a73d0bd87ebca13db4cea22ef0 /online_test/celery.py
parent4802a89acef7567c6a8861daab60924fe862367f (diff)
downloadonline_test-348f2bc4f727b27abd9878334e886527479d260c.tar.gz
online_test-348f2bc4f727b27abd9878334e886527479d260c.tar.bz2
online_test-348f2bc4f727b27abd9878334e886527479d260c.zip
Merge monitor, grade user and regrade intosingle dashboard
Diffstat (limited to 'online_test/celery.py')
-rw-r--r--online_test/celery.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/online_test/celery.py b/online_test/celery.py
new file mode 100644
index 0000000..582f8a1
--- /dev/null
+++ b/online_test/celery.py
@@ -0,0 +1,19 @@
+from __future__ import absolute_import, unicode_literals
+
+import os
+from django.conf import settings
+from celery import Celery
+
+# set the default Django settings module for the 'celery' program.
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'online_test.settings')
+
+app = Celery('online_test')
+
+# Using a string here means the worker doesn't have to serialize
+# the configuration object to child processes.
+# - namespace='CELERY' means all celery-related configuration keys
+# should have a `CELERY_` prefix.
+app.config_from_object('django.conf:settings', namespace='CELERY')
+
+# Load task modules from all registered Django app configs.
+app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)