|
@@ -1,6 +1,7 @@
|
|
|
import cgi
|
|
|
import codecs
|
|
|
import copy
|
|
|
+import warnings
|
|
|
from io import BytesIO
|
|
|
from itertools import chain
|
|
|
from urllib.parse import quote, urlencode, urljoin, urlsplit
|
|
@@ -15,6 +16,7 @@ from django.http.multipartparser import MultiPartParser, MultiPartParserError
|
|
|
from django.utils.datastructures import (
|
|
|
CaseInsensitiveMapping, ImmutableList, MultiValueDict,
|
|
|
)
|
|
|
+from django.utils.deprecation import RemovedInDjango40Warning
|
|
|
from django.utils.encoding import escape_uri_path, iri_to_uri
|
|
|
from django.utils.functional import cached_property
|
|
|
from django.utils.http import is_same_domain, limited_parse_qsl
|
|
@@ -256,6 +258,11 @@ class HttpRequest:
|
|
|
return self.scheme == 'https'
|
|
|
|
|
|
def is_ajax(self):
|
|
|
+ warnings.warn(
|
|
|
+ 'request.is_ajax() is deprecated. See Django 3.1 release notes '
|
|
|
+ 'for more details about this deprecation.',
|
|
|
+ RemovedInDjango40Warning,
|
|
|
+ )
|
|
|
return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest'
|
|
|
|
|
|
@property
|