Interacting with Django shell command

November 20, 2020

To enter to the shell run the following command

>python3 manage.py shell

Inside the shell, you can connect the models

>from post.models import Post

Now you can retrieve all the records of the tabel

>Post.objects.all()

<QuerySet [<Post: Post object (1)>, <Post: Post object (2)>]>