如何向Django Celery Flower Monitoring添加身份验证和端点?

tze*_*man 14 django celery django-celery django-deployment flower

我一直在本地使用花,它似乎很容易设置和运行,但我看不出如何在生产环境中设置它.

特别是,如何添加身份验证以及如何定义访问它的URL?

Nei*_*eil 13

对于自定义地址,请使用--address标志.对于auth,请使用--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)
Run Code Online (Sandbox Code Playgroud)