title: AttributeError: 'Flask' object has no attribute 'user_options'
body: <p>I am trying to setup this basic example from the following doc:</p>
  
  <blockquote>
    <p><a href="http://flask.pocoo.org/docs/patterns/celery/" rel="noreferrer">http://flask.pocoo.org/docs/patterns/celery/</a></p>
  </blockquote>
  
  <p>But so far I keep getting the below error:</p>
  
  <blockquote>
    <p>AttributeError: 'Flask' object has no attribute 'user_options'</p>
  </blockquote>
  
  <p>I am using celery 3.1.15.</p>
  
  <pre><code>from celery import Celery
  
  def make_celery(app):
      celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'])
      celery.conf.update(app.config)
      TaskBase = celery.Task
      class ContextTask(TaskBase):
          abstract = True
          def __call__(self, *args, **kwargs):
              with app.app_context():
                  return TaskBase.__call__(self, *args, **kwargs)
      celery.Task = ContextTask
      return celery
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  app.config.update(
      CELERY_BROKER_URL='redis://localhost:6379',
      CELERY_RESULT_BACKEND='redis://localhost:6379'
  )
  celery = make_celery(app)
  
  
  @celery.task()
  def add_together(a, b):
      return a + b
  </code></pre>
  
  <p>Traceback error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/local/bin/celery", line 11, in &lt;module&gt;
      sys.exit(main())
    File "/usr/local/lib/python2.7/dist-packages/celery/__main__.py", line 30, in main
      main()
    File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 81, in main
      cmd.execute_from_commandline(argv)
    File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 769, in execute_from_commandline
      super(CeleryCommand, self).execute_from_commandline(argv)))
    File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 305, in execute_from_commandline
      argv = self.setup_app_from_commandline(argv)
    File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 473, in setup_app_from_commandline
      user_preload = tuple(self.app.user_options['preload'] or ())
  AttributeError: 'Flask' object has no attribute 'user_options'
  </code></pre>