17

I've been using flower locally and it seems easy enough to setup and run, but I can't see how I would set it up in a production environment.

In particular, how can I add authentication and how would I define a url to access it?

MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
tzenderman
  • 2,523
  • 3
  • 21
  • 24
  • 1
    Can you please help to setup flower with celeryd.... Actually I am running celery by `python manage.py celeryd` it is running well but when I am trying to run flower by `celery flower -A proj --address=127.0.0.1 --port=5555` it is not getting run... – Vikram Singh Chandel Feb 01 '17 at 09:13

2 Answers2

15

For custom address, use the --address flag. For auth, use the --basic_auth flag.

See below:

# 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)
Neil
  • 7,042
  • 9
  • 43
  • 78
  • I tried both the external ip as well as 0.0.0.0, but was not successful. – Mohit Nov 19 '15 at 13:47
  • 1
    Grrr, basic auth. I already have a nice auth setup for django. Now a second one. Is there no way to make flower a part of my django project? – guettli Apr 09 '21 at 11:14
1

You an use https://pypi.org/project/django-revproxy/

This way Flower is hidden behind Django auth which, and you don't need rewrite rule in your webserver.

Orignal source of this answer: Celery Flower Security in Production

guettli
  • 25,042
  • 81
  • 346
  • 663