如何在Django Celery Flower监控中添加认证和端点?

17

我一直在本地使用Flower,它似乎很容易设置和运行,但我不知道如何在生产环境中设置它。

特别是,我该如何添加认证功能和定义访问它的URL地址?


1
你能帮忙设置flower和celeryd吗? 实际上,我正在通过python manage.py celeryd运行celery,它运行良好,但是当我尝试通过celery flower -A proj --address=127.0.0.1 --port=5555运行flower时,它无法运行... - Vikram Singh Chandel
2个回答

15

如需自定义地址,请使用--address标志。

对于身份验证,请使用--basic_auth标志。

请参见下文:

# celery flower --help
Usage: /usr/local/bin/celery [OPTIONS]

Options:

  --address                        run on the given address
  --auth                           regexp  of emails to grant access
  --basic_auth                     colon separated user-password to enable
                                   basic auth
  --broker_api                     inspect broker e.g.
                                   http://guest:guest@localhost:15672/api/
  --certfile                       path to SSL certificate file
  --db                             flower database file (default flower.db)
  --debug                          run in debug mode (default False)
  --help                           show this help information
  --inspect                        inspect workers (default True)
  --inspect_timeout                inspect timeout (in milliseconds) (default
                                   1000)
  --keyfile                        path to SSL key file
  --max_tasks                      maximum number of tasks to keep in memory
                                   (default 10000) (default 10000)
  --persistent                     enable persistent mode (default False)
  --port                           run on the given port (default 5555)
  --url_prefix                     base url prefix
  --xheaders                       enable support for the 'X-Real-Ip' and
                                   'X-Scheme' headers. (default False)

我尝试了外部IP和0.0.0.0,但没有成功。 - Mohit
1
Grrr,基本认证。我已经为Django设置了一个不错的认证系统。现在需要第二个。难道没有办法将Flower作为我的Django项目的一部分吗? - guettli

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接