Showing Deprecation Warnings Only for a Specific Version When Testing Django

Add this to your manage.py:

import warnings
from django.utils.deprecation import RemovedInDjango110Warning

warnings.filterwarnings('always', category=RemovedInDjango110Warning)

Change 'always' to 'default' to ignore redundant messages or to 'error' to cause the program to fail on warnings.


A good way to limit the output to only show deprecation warnings is running:

python -Wd manage.py check

or

python -Wd manage.py test