In my models.py:
from django.db import models
from core import tasks
class Image(models.Model):
image = models.ImageField(upload_to=\'images/orig\')
i wonder if the problem might be a circular import (models
and tasks
importing each other at the top level). try moving "from core.models import Image
" into create_thumbnail
, i.e. changing tasks
to
from celery.decorators import task
@task()
def create_thumbnail(image_id):
from core.models import Image
ImageObj = Image.objects.get(id=image_id)
# other stuff here