title: How to pass a request in template tag in Django?
body: <p>I am working on a web based application in Django. My application is full of widget(not a Django-widgets) which is used for load the different types data using Ajax. For example a 'student' name widgets are loading list of users and a 'teacher' name widget are loading the list of all teacher in a school. To doing this i am getting some following doubts in mind:</p>
  
  <p><li> I am using templatetag (take a look on the code <a href="http://codepad.org/2Ug9Ct3n" rel="nofollow">http://codepad.org/2Ug9Ct3n</a>). In this code when i am doing <code>if request and request.is_ajax():</code>it showing me an error <code>None object has no attribute ajax</code>. The problem is this that i am not able to include request properly. I have already make changes into my <code>setting.py</code> i.e.</p>
  
  <pre><code> TEMPLATE_CONTEXT_PROCESSORS = (
   'django.contrib.auth.context_processors.auth',
   'django.core.context_processors.static',
   'django.core.context_processors.request',
   'django.core.context_processors.media',
   )
  </code></pre>
  
  <p></li>
  <li> If that thing has no solution then would it be possible for me to write the whole template tag part in views.py? and how? </li>
  Instead of that if there are any possibility please post them as a answer!</p>
  
  <p>Any help will be appreciable </p>