title: How to return 404 page intentionally in django
body: <p>I made custom 404 page in django. And I'm trying to get 404 error page intentionally.</p>
  
  <p><strong>myproject/urls.py:</strong></p>
  
  <pre><code>from website.views import customhandler404, customhandler500, test
  
  urlpatterns = [
      re_path(r'^admin/', admin.site.urls),
      re_path(r'^test/$', test, name='test'),
  ]
  handler404 = customhandler404
  handler500 = customhandler500
  </code></pre>
  
  <p><strong>website/views.py</strong></p>
  
  <pre><code>def customhandler404(request):
      response = render(request, '404.html',)
      response.status_code = 404
      return response
  
  
  def customhandler500(request):
      response = render(request, '500.html',)
      response.status_code = 500
      return response
  
  def test(request):
      raise Http404('hello')
  </code></pre>
  
  <p>But when I go 127.0.0.1:8000/test/ , It seems to return <code>500.html</code></p>
  
  <p>And terminal says:</p>
  
  <p><code>[24/Mar/2018 22:32:17] "GET /test/ HTTP/1.1" 500 128</code></p>
  
  <p>How can I intentionally get 404 page?</p>