Often I find myself wanting to get the first object from a queryset in Django, or return None if there aren\'t any. There are lots of ways to do this which all
None
Now, in Django 1.9 you have first() method for querysets.
first()
YourModel.objects.all().first()
This is a better way than .get() or [0] because it does not throw an exception if queryset is empty, Therafore, you don't need to check using exists()
.get()
[0]
exists()