title: Can you check the internet protocol from Django's template?
body: <p>Right now, if I want to check whether the current page is accessed through <code>http://</code> or <code>https://</code>, I will use the following Javascript in my templates and write html from <code>document.write</code>:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var protocol = document.location.protocol;
  if (protocol == "http:")
      document.write("regular");
  else
      document.write("secured");
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there another way to achieve the above in Django's template without using Javascript?</p>