每次我使用django-admin
命令时-甚至在TAB-完成时-它都会抛出RemovedInDjango19Warning
(如果我使用test命令,还会抛出更多).我如何才能 suppress 这些警告呢?
我正在使用Django 1.8和Python3.4(在虚拟环境中).据我所知,所有这些警告都来自库,而不是我的代码.
例子
以下是一些示例:
…/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes. return f(*args, **kwds)
…/lib/python3.4/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)
个…/lib/python3.4/site-packages/django/templatetags/future.py:25: RemovedInDjango19Warning: Loading the ``url`` tag from the ``future`` library is deprecated and will be removed in Django 1.9. Use the default ``url`` tag instead. RemovedInDjango19Warning)
Update
由于Django版本1.11(release notes),默认情况下,不推荐警告不再响亮.所以我想这不再是一个问题了,因为1.11是支持Python2的最后一个版本,并且还具有长期支持功能.