老师,我的工作可以run起来,前台界面可以显示的,但是扫描时报错
来源:1-1 自动化运维开发实战课程导学
sunshinebao
2018-06-02
三台虚拟机,一台作为服务端,目前工作可以run 起来,但是现在想通过自动扫描,发现另外两台,报如下错误,请老师指点:
/opt/python2.7/bin/python ./main.py er
/home/rlg/imoocc_online/apps/detail/models.py:7: RemovedInDjango19Warning: Model class detail.models.ConnectionInfo doesn't declare an explicit app_label and ei ther isn't in an application in INSTALLED_APPS or else was imported before its a pplication was loaded. This will no longer be supported in Django 1.9.
class ConnectionInfo(models.Model):
Traceback (most recent call last):
File "./main.py", line 34, in <module>
from apps.detail.utils.machines import Machines
File "/home/rlg/imoocc_online/apps/detail/utils/machines.py", line 3, in <modu le>
from detail.models import *
File "/home/rlg/imoocc_online/apps/detail/models.py", line 7, in <module>
class ConnectionInfo(models.Model):
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/base.py", li ne 309, in __new__
new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
File "/opt/python2.7/lib/python2.7/site-packages/django/apps/registry.py", lin e 221, in register_model
(model_name, app_label, app_models[model_name], model))
RuntimeError: Conflicting 'connectioninfo' models in application 'detail': <clas s 'apps.detail.models.ConnectionInfo'> and <class 'detail.models.ConnectionInfo' >.
1回答
-
Jeson
2018-06-02
你好,这个问题是之前老版本中的一个bug,现在新版本已经修复了这个问题了。
你可以从github中更新下代码,然后试试。
或者也可以尝试自己修复,这个是修改的方式:https://coding.imooc.com/learn/questiondetail/47649.html
022018-06-03
相似问题