Django是否在这个错误消息中抱怨自己?
当我启动服务器时,我得到:Django是否在这个错误消息中抱怨自己?,django,Django,当我启动服务器时,我得到: /usr/lib64/python2.7/site-packages/django/contrib/admin/util.py:7: RemovedInDjango19Warning: The django.contrib.admin.util module has been renamed. Use django.contrib.admin.utils instead. "Use django.contrib.admin.utils instead.", Rem
/usr/lib64/python2.7/site-packages/django/contrib/admin/util.py:7: RemovedInDjango19Warning: The django.contrib.admin.util module has been renamed. Use django.contrib.admin.utils instead.
"Use django.contrib.admin.utils instead.", RemovedInDjango19Warning)
/usr/lib64/python2.7/site-packages/django/contrib/contenttypes/models.py:159: RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class ContentType(models.Model):
/usr/lib64/python2.7/site-packages/django/contrib/admin/util.py:7: RemovedInDjango19Warning: The django.contrib.admin.util module has been renamed. Use django.contrib.admin.utils instead.
"Use django.contrib.admin.utils instead.", RemovedInDjango19Warning)
/usr/lib64/python2.7/site-packages/django/contrib/contenttypes/models.py:159: RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class ContentType(models.Model):
Performing system checks...
System check identified no issues (0 silenced).
September 14, 2015 - 19:45:18
Django version 1.8.4, using settings 'viewer.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
这四个
是不是应该被忽略?我在代码中搜索了上述问题,但在代码中找不到这些问题。对于内容类型警告,请确保您的安装的应用程序设置中有内容类型。这是必需的,因为项目中的某些代码(例如在django mass edit中)使用ContentType
模型
INSTALLED_APPS = (
...
'django.contrib.contenttypes',
...
)
另一个django.contrib.admin.util
警告已在django mass edit中修复,但在撰写本文时还没有新版本。因为这只是一个不推荐使用的警告,所以在实际升级到Django 1.9之前,您不必担心它。另一种可能是您安装的第三方应用程序使用了不推荐使用的内容。@Chucksash:我没有考虑过,谢谢!看起来我有很多检查要做。我发现了第一个和第三个错误的罪魁祸首:django批量编辑代码已经被修复,但从那以后似乎再也没有发布过。因为这只是一个弃用警告,你不必担心。@Alasdair:很好,我不知道,谢谢!