Django: Shell Cheat Sheet

Start a shell session

python manage.py shell

Access data from the project

from learning_logs.models import Topic

Topic.objects.all()
topic = Topic.objects.get(id=1)
topic.text 'Chess'

Leave a Reply

Your email address will not be published. Required fields are marked *