Tring out Django Celery for the first time, new to Django and Celery.
Below is what I have so far trying I get the following error...
RuntimeError at /contacts/upload maximum recursion depth exceeded
I'm using SQS and the message broker.
settings.py
# Celery
import djcelery
djcelery.setup_loader()
INSTALLED_APPS += (
'south',
'userena',
'social_auth',
'djcelery',
)
BROKER_TRANSPORT = 'sqs'
BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-west-1',
}
BROKER_USER = 'xyz'
BROKER_PASSWORD = 'zyx'
tasks.py
@task
def upload(request, **kwargs):
file = request.FILES['file']
ContactCSVModel.import_from_file(file)
return True
view.py
@login_required
def upload(request):
result = upload(request)
if result:
messages.add_message(request, messages.SUCCESS, 'Items have been added to the database.')
else:
etc
Can someone please help me understand what I'm doing wrong here. Thank you.