title: Flask AttributeError: 'Blueprint' object has no attribute 'response_class'
body: <p>I am trying to have my Flask route return a stream of text outputted from a log line by line back to my AJAX call like this:</p>
  
  <p>my_app/auth/views.py:</p>
  
  <pre><code>@bp.route('/output_stream', methods=['GET', 'POST'])
  def output_stream():
      def generate():
          if request.method == "POST":
              ...
              ...
              for line in iter(lambda: stdout.readline(2048), ""):
                  data_buffer += line
                  print(line, end="")
                  yield line + '\n'
                  if re.search(r'Done', line):
                      print('No more data')
                      break
  
              print('finished.')
  
              client.close()
  
      return bp.response_class(generate(), mimetype='text/plain')
  </code></pre>
  
  <p>I am registering my Flask app in <code>__init__.py</code> like this:</p>
  
  <pre><code>from flask import Flask
  
  ...
  app = Flask(__name__)
  
  ...
  ...
  
  from my_app.auth.views import bp
  app.register_blueprint(bp)
  </code></pre>
  
  <p>However, it keeps throwing out <code>Flask AttributeError: 'Blueprint' object has no attribute 'response_class'</code> for some reason. </p>
  
  <p>My Flask is up to date:</p>
  
  <pre><code># pip install --upgrade Flask
  Requirement already up-to-date: Flask in /usr/lib/python3.5/site-packages (1.0.2)
  </code></pre>
  
  <p>Does anyone know what might be the problem here? </p>