title: How create decorator in Django for decorating view
body: <p>I have view:</p>
  
  <pre><code>@decorator
  def func(request):
    hello = "hello"
    return render_to_responce("test.html", locals() )
  </code></pre>
  
  <p>and template test.html:</p>
  
  <pre><code>{{ hello }}
  {{ username }}
  </code></pre>
  
  <p>I want to write decorator for <code>func(request)</code>, which adds a variable, USERNAME, to the function and returns two parameters in the template. I tried to make it as follows:</p>
  
  <pre><code>def decorator(func):
      def wrapper( request, *args, **kwargs):
          username = request.user.username
          q = func(request, *args, **kwargs)
          #what I need add here I do not know ...
          return q   
      return wrapper
  </code></pre>