title: pyramid.httpexceptions.HTTPNotFound: The resource could not be found
body: <p>I am working off of Safari's Pyramid tutorial</p>
  
  <blockquote>
    <p>WEB APPLICATIONS WITH PYTHON AND THE PYRAMID FRAMEWORK</p>
  </blockquote>
  
  <p>Inside of my <code>views.py</code> file I having a problem with the following code:</p>
  
  <pre><code>@property
  def current(self):
      todo_id = self.request.matchdict.get('id')
      todo = sample_todos.get(todo_id)
      if not todo:
          raise HTTPNotFound()
      return todo
  </code></pre>
  
  <p>particularly when the following view function calls this property</p>
  
  <pre><code>@view_config(route_name='view', renderer='templates/view.jinja2')
  def view(self):
      return dict(todo=self.current)
  </code></pre>
  
  <p>when I am running the application <code>http://0.0.0.0:6543/5</code> will not trigger the anticipated <code>HTTPNotFound()</code>, see route below.</p>
  
  <pre><code>config.add_route('view', '/{id}')
  </code></pre>
  
  <p>the error logs return:   </p>
  
  <pre><code>  File "/Users/alex/zdev/t-oreilly/mysite/views.py", line 50, in view
      return dict(todo=self.current)
    File "/Users/alex/zdev/t-oreilly/mysite/views.py", line 25, in current
      raise HTTPNotFound()
  pyramid.httpexceptions.HTTPNotFound: The resource could not be found.
  </code></pre>
  
  <p>On the browser waitress returns a default server error.</p>
  
  <p><strong>What is the proper way to remove this error?</strong></p>
  
  <hr>
  
  <p>I have uploaded this work to <a href="https://github.com/AlexanderMcNulty/oreilly-pyramid-tutorial" rel="nofollow noreferrer">github</a>, commit <strong>aaf562e</strong></p>
  
  <p>the tutorial link is <a href="https://www.safaribooksonline.com/library/view/web-applications-with/9781771374361/" rel="nofollow noreferrer">here</a>, for those eager to help, it can be accessed with their 10 day trial. This problem is from video 17/48.</p>
  
  <p>thank you, if you need additional information please let me know.</p>