I've followed the instruction process to installing and setting up celery, now I'm trying to execute my task. My project tree looks like this:
bin
draft1--
|
-------draft1 ----
|
--------celery.py
--------tasks.py
--------views.py
-------manage.py
-------templates
include
lib
Here's my code:
settings.py
CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//'
celery.py
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
app = Celery('app')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
tasks.py
from celery import shared_task
@shared_task
def print_this():
print('ONE MINUTE')
app.views
print_this.delay()
So my celery function doesn't work, it doesn't execute the print statement. What I want to do is execute the function every minute. Any idea what the problem is?