About the Underscore in Django Shell

In the Django Interactive Shell or Python Shell, underscore (_) refers to the result of the previously executed command.

1
2
3
>>> Post.objects.filter(title="Hello, World!")
[<Post: Hello, World!>, <Post: Hello, World!>]
>>> post1, post2 = _

Tips and Tricks Development Django 2.2 Django 1.11 Django 1.8 Python 3