title: Not able to set custom 404 page (Django 1.9)
body: <p>I'm not able to set a custom 404 page in my application. I know there are many such answers around and I've read a few but they didn't help. Specifically, I tried setting the <code>ALLOWED_HOSTS</code> to <code>['*']</code>, adding <code>TEMPLATE_DEBUG = False</code> and adding <code>--insecure</code> to <code>runserver</code>. Both these didn't help.</p>
  
  <p>Here are the steps I followed:</p>
  
  <p>Created the page <code>ankblog/not_found.html</code>.</p>
  
  <p>Added this to my <code>views.py</code>:</p>
  
  <pre><code>def not_found(request):
      return render(request, 'ankblog/not_found.html')
  </code></pre>
  
  <p>Added this to my <code>urls.py</code>:</p>
  
  <pre><code>from ankblog import views as ank_view
  handler404 = 'ank_view.not_found'
  </code></pre>
  
  <p>In <code>settings.py</code>:</p>
  
  <pre><code>DEBUG = False
  ALLOWED_HOSTS = ['*'] # also tried 'localhost'
  </code></pre>
  
  <p>I'm getting a 500 server error instead of the expected page. Also, if I change <code>ALLOWED_HOSTS</code> to <code>['localhost']</code> I get a 400 error (on accessing any page, so I guess it's a mistake in general).</p>
  
  <p>I'm pretty sure it's small thing I'm missing somewhere but not sure what. Please help!</p>