Answer the question
In order to leave comments, you need to log in
Pycharm shell how to load Django?
When executing a command in shell
>>> from info.models import MysiteInfo
>>> mm = MysiteInfo.objects.get(id=3)
raise AppRegistryNotReady("Models aren't loaded yet.")
AppRegistryNotReady: Models aren't loaded yet.
>>> import django
>>> django.setup()
>>> from django.db import connection
>>> mm = MysiteInfo.objects.get(id=3)
>>> print mm
Запись 3
import django
django.setup()
Answer the question
In order to leave comments, you need to log in
File>Settings>Build, Execution, Deployment>Console>Django Console. What to do there I think you will understand. Of course, if I correctly understood the essence of the question. This is for pycharm 4.0
File>Settings>Project Settings>Console>Django Console. This is for pycharm 3.4
winordie
Thank you so much for the hint, I corrected the error. In the manage.py file, I connected pymysql there, after uninstalling this module, I removed this code from manage.py
import pymysql
pymysql.install_as_MySQLdb()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question