In my models.py:
from django.db import models
from core import tasks
class Image(models.Model):
image = models.ImageField(upload_to=\'images/orig\')
You don't need to import the task itself. Try using the following
from django.db import models
from celery.execute import send_task, delay_task
class Image(models.Model):
image = models.ImageField(upload_to='images/orig')
thumbnail = models.ImageField(upload_to='images/thumbnails', editable=False)
def save(self, *args, **kwargs):
super(Image, self).save(*args, **kwargs)
result = delay_task("task_prefix.create_thumbnail", post.id)