title: Catch signals in Flask Blueprint
body: <p>I'm busy writing a RESTful API in flask using flask views to drive the API. Since the application is sizable, I'm modularizing the code into blueprints. I've run into some trouble when trying to catch signals in a blueprint. I can happily write the 'connect signal' code in my main <code>__init__.py</code> file but I'd like to write the signal listeners in the relevant blueprint so as not to have the main <code>create_app</code> method cluttered with blueprint specific code.</p>
  
  <p>Currently I have this [simplified] working code:</p>
  
  <pre><code>def create_app(debug=False):
      app = Flask(__name__)
      ...
      app.register_blueprint(my_blueprint)
      @mysignal.connect_via(app)
      def print_howdy(sender, **extra):
         print "howdy"
  </code></pre>
  
  <p>I'd like to move the signal connection code into my_blueprint, but cannot find a way to do that elegantly. How can I make this work?</p>