-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError('need more than 1 value to unpack',) #171
Comments
I would check the resulting Task object that was created; I've gotten that error when the task had no args / kwargs. |
I just implemented your code snippet and debugged it. So maybe try to create a task.py file containing all your tasks and execute them like this: |
yes @qb1989 is right. You either reference the function directly without quotes: @login_required
def makea_math(request):
resp = {}
resp['retrr'] = result(async(math_task, '123131.12312'), 100)
return HttpResponse(json.dumps(resp), content_type="application/json") This works fine with local functions and classes. Or you have to use the full paths to the functions: @login_required
def makea_math(request):
resp = {}
resp['retrr'] = result(async('my_project.views.math_task', '123131.12312'), 100)
return HttpResponse(json.dumps(resp), content_type="application/json") This is what I tend to do all the time. The reason you see that error, is cause you are feeding the |
@ Koed00 thanks. That was exactly the issue. I managed to fix this before your answer but thanks |
Awesome. Sorry, sometimes I don't respond as fast as I'd like to. |
This library is very useful and I really appreciate for it. In my case. async('async_tasks.finish_practice', 3, sync=True) results in async(async_tasks.finish_practice, 3, sync=True) works without problem. Could you reopen and shed light on this issue?
|
If you are going to use the quoted path you will have to include the base module:
That string needs to be importable from the root. |
I am testing django-q as production msg que and schedule library. I made simple function:
but each time I get the error from broker:
ValueError('need more than 1 value to unpack'
Is there any way to debug or check broker logs and check what went wrong ?
I am running Django : 1.9.6
Django REST framework: 3.3.2
The text was updated successfully, but these errors were encountered: