title: Django decorators passing variable to views
body: <p>Hi Iam using Django Decorators.</p>
  
  <p>I want to pass a variable from decorators to views function.</p>
  
  <p>Is it possible means please help me..</p>
  
  <pre><code>def d(msg='my default message', alt="none"):
      def decorator(func):
          def newfn(request, **kwargs):
              if msg and alt:
                 variable = "Read Only"
              return func(request, **kwargs)
          return newfn
      return decorator
  </code></pre>
  
  <p>I want the variable to be passed from decorators to view.</p>
  
  <pre><code>@d('hai', 'begin')
  def company(request):
     print variable
     return ...
  </code></pre>
  
  <p>Anyone help me. Thanks in Advance</p>