title: django template statement if != Null doesn't work
body: <p>@Fixed</p>
  
  <p>I got problem with template tag <code>{% if ... in ... %}</code>. I'm trying to write statements if object don't exist ( equal Null ) then don't display anything. My model got few fields for links to SOcial Media like instagram, facebook, twitter etc. and not every company got every social media as we know. The problem is that those If statements doesn't work as they should (I checked django documentation), for example if company have added links to all social medias (twitter,fb,instagram,linkedin,website) it should display images with links to them. But if company have not added any link to social medias or website, it shouldnt display images. I don't know why those statements doesn't work</p>
  
  <p>About images, if I remove the loop <code>{% for ... %} {% endfor %}</code>
  then it is displaying all images even if company has not associated any links so this if statements also doesnt work then</p>
  
  <p>/EDIT</p>
  
  <p>I had to change those statements like </p>
  
  <pre><code>% if brand.website != None %}
  </code></pre>
  
  <p>to </p>
  
  <pre><code>{% if brand.website %}
  </code></pre>
  
  <p>and it fixed all</p>
  
  <p>comp_view.html</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;div class="social-media"&gt;
  {% for brand in brands %
  {% if brand.website != None %}
      &lt;a class="" href="{{ brand.website }}"&gt;
          &lt;img src="/static/icons/website.png"&gt;
      &lt;/a&gt;
  {% endif %}
  
  {% if brand.facebook != None %}
      &lt;a class="" href="{{ brand.facebook }}"&gt;
          &lt;img src="/static/icons/facebook.png"&gt;
      &lt;/a&gt;
  {% endif %}
  
  {% if brand.instagram != None %}
  &lt;a class="" href="{{ brand.instagram }}"&gt;
      &lt;img src="/static/icons/instagram.png"&gt;
  &lt;/a&gt;
  {% endif %}
  
  {% if brand.twitter != None %}
      &lt;a class="" href="{{ brand.twitter }}"&gt;
          &lt;img src="/static/icons/twitter.png"&gt;
      &lt;/a&gt;
  {% endif %}
  
  {% if brand.linkedin != None %}
      &lt;a class="" href="{{ brand.linkedin }}"&gt;
          &lt;img src="/static/icons/linkedin.png"&gt;
      &lt;/a&gt;
  {% endif%}
  {% endfor %}
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>views.py </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>def brands(request, slug):
      brand = get_object_or_404(Company, slug=slug)
      return render(request, 'company/comp_view.html', {'brand': brand})</code></pre>
  </div>
  </div>
  </p>
  
  <p>models.py </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Company(models.Model):
      ...
      technologies = models.ManyToManyField('Stack')
      website = models.TextField(max_length=150, blank=True, null=True, validators=[URLValidator()])
      facebook = models.TextField(max_length=150, blank=True, null=True, validators=[URLValidator()])
      instagram = models.TextField(max_length=150, blank=True, null=True, validators=[URLValidator()])
      twitter = models.TextField(max_length=150, blank=True, null=True, validators=[URLValidator()])
      linkedin = models.TextField(max_length=150, blank=True, null=True, validators=[URLValidator()])</code></pre>
  </div>
  </div>
  </p>