Fix Celery: add django.setup() before importing tasks
This commit is contained in:
+5
-1
@@ -1,8 +1,12 @@
|
|||||||
from celery import Celery
|
from celery import Celery
|
||||||
import os
|
import os
|
||||||
|
|
||||||
app = Celery('proyecto')
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proyecto.settings')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proyecto.settings')
|
||||||
|
|
||||||
|
app = Celery('proyecto')
|
||||||
app.config_from_object('django.conf:settings', namespace="CELERY")
|
app.config_from_object('django.conf:settings', namespace="CELERY")
|
||||||
|
|
||||||
|
import django
|
||||||
|
django.setup()
|
||||||
|
|
||||||
from tienda import tasks
|
from tienda import tasks
|
||||||
Reference in New Issue
Block a user