title: How can a Flask decorator have arguments?
body: <p>I implemented a decorator in the same way as here
  <a href="https://stackoverflow.com/questions/13896650/how-to-make-a-python-decorator-function-in-flask-with-arguments-for-authorizati">How to make a python decorator function in Flask with arguments (for authorization)</a>
  but problem still unsolved...</p>
  
  <p>I have this function with decorators</p>
  
  <pre><code>@blueprint.route('&lt;var&gt;')
  @blueprint.my_decorator(var)
  def function(var):
      do stuff
  </code></pre>
  
  <p>and I get this error</p>
  
  <pre><code>NameError: global name 'var' is not defined
  </code></pre>
  
  <p>How do I solve this?</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>The blueprint is a class inheriting the Blueprint class.
  So I implemented the method</p>
  
  <pre class="lang-python prettyprint-override"><code>def my_decorator(self, fn):
      @wraps(fn)
      def decorator(*args, **kwargs):
          value = kwargs['value']
          # do stuff with value
          return fn(*args, **kwargs)
      return decorator
  </code></pre>
  
  <p>but still the value is an uknown key...</p>