title: Better way to check if a object is present in Django ORM among Get/Filter?
body: <p>Lets consider I am trying to find if a user with primary key 20 exists or not? I can do this in 2 ways.</p>
  
  <p>The First one : </p>
  
  <pre><code>try:
     user = User.objects.get(pk=20)
  except User.DoesNotExist:
     handle_non_existent_user()
  </code></pre>
  
  <p>The other way could be :</p>
  
  <pre><code>users = User.objects.filter(pk=20)
  if not users.exists():
     handle_non_existent_user()
  </code></pre>
  
  <p>Which is better method to do check existence?</p>
  
  <p>This might be related to this : <a href="https://stackoverflow.com/questions/11025118/what-is-the-best-way-to-check-if-data-is-present-in-django">What is the best way to check if data is present in django?</a>
  However, people favoured the first method because of specified examples did not had the reference of model queryset.</p>
  
  <p>Also in the answer of following question : <a href="https://stackoverflow.com/questions/639836/what-is-the-right-way-to-validate-if-an-object-exists-in-a-django-view-without-r">what is the right way to validate if an object exists in a django view without returning 404?</a>
  It is largely based because we are not getting the reference of object in question.</p>