Can't import models in Python shell
Question:
I’m doing the Django official tutorial (documentation). I’ve created two database models (Question, Choice). I’m trying to import them by first entering the python shell by using python manage.py shell
Then I run from polls.models import Question,Choice
and nothing happens, it just enters an empty line. In the documentation, it’s showed that I’m supposed to see some information regarding the database.
I’ve done the migration and also put the app config in settings.py
Answers:
Then I run from polls.models import Question, Choice
and nothing happens, it just enters an empty line.
That’s what should happen. In the tutorial, you can see that you’re expected to enter more things, e.g. Question.objects.all()
to see that there are no questions.
I’m doing the Django official tutorial (documentation). I’ve created two database models (Question, Choice). I’m trying to import them by first entering the python shell by using python manage.py shell
Then I run from polls.models import Question,Choice
and nothing happens, it just enters an empty line. In the documentation, it’s showed that I’m supposed to see some information regarding the database.
I’ve done the migration and also put the app config in settings.py
Then I run
from polls.models import Question, Choice
and nothing happens, it just enters an empty line.
That’s what should happen. In the tutorial, you can see that you’re expected to enter more things, e.g. Question.objects.all()
to see that there are no questions.