title: Name Error: global name 'loader' is not defined
body: <p>I want to fetch a data from models in django . i have a code but there is an name error.
  views.py
  def news(request):</p>
  
  <pre><code>from django import template
      from django.template.loader import get_template 
  
      template_source_loaders = None
          template = loader.get_template("news.html")
          warning_list = []
          news_list = []
          blog_query = blogs.object.all()
  
          for news_entry in blog_query:
              news_list.append(news_entry)
          #except Exception, e:
              warning_list.append(e.message)
          context = Context({
              'news_list':news_list,
              'warnings' :warning_list,
              })
          return HttpResponse(template.render(context))
  </code></pre>
  
  <p>template:-</p>
  
  <pre><code>{%if warnings%}
   {%for warning in warnings%}
     {{warning}}
          {%endfor%}
      {%endif%}
      {%if news_list%}
          {%for news in news_list%}
              {{news.headline}}
              {{news.date}}
              {{news.content}}
              &lt;a href="{{news.author.website}}"&gt;{{news.author.author}}&lt;/a&gt;
          {%endfor%}
      {%endif%}
  </code></pre>
  
  <p>please help me to solve this problem.</p>