Fix DeprecationWarning under modern versions of Django