python manage.py shell问题
来源:7-7 modelform提交我要学习咨询1
guoyumo
2017-06-19
老师,在用shell测试的时候,导入models报错.
Traceback (most recent call last):
File "/home/yumo/workvenv/d2.7/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2882, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-2664a6f07ed2>", line 1, in <module>
from apps.organization.models import Courseorg
File "/home/yumo/Downloads/pycharm-2017.1.3/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/yumo/myproject/Mxonline2/apps/organization/models.py", line 7, in <module>
class CityDict(models.Model):
File "/home/yumo/workvenv/d2.7/local/lib/python2.7/site-packages/django/db/models/base.py", line 102, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class apps.organization.models.CityDict doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
请问这是什么原因啊
1回答
-
你这里通过pycharm运行有没有问题? 你给我发个qq消息 我给你看一下吧
052017-07-05
相似问题