I have a working celery flower project.
Now I want some celery failed task details using flower http api, but my celery is using --basic-auth for authentication and when I make a request at flower http api on http://localhost:5555/api/tasks it timeouts and does not show any results.
I did not understand if this is an auth problem or something else. I look to flower docs but i did not get any idea. Thanks for you time. Below is the code that is not working for me.
import requests
params = (('state', 'FAILURE'),('limit', '5'),)
requests.get('http://localhost:5555/api/tasks', params=params)
Then you should make your request with your credentials:
Import HTTPBasicAuth (since you are using --basic-auth):
from requests.auth import HTTPBasicAuth
Make an authenticated request:
requests.get(
'http://localhost:5555/api/tasks',
auth=HTTPBasicAuth('your_user', 'your_pass'),
params=params
)
Good luck :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With