Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can't import models in Python shell

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading