E
E
Egor Samarin2020-12-11 15:09:36
Django
Egor Samarin, 2020-12-11 15:09:36

'TUPLE' OBJECT HAS NO ATTRIBUTE 'GET?

Environment:

Request Method: GET
Request URL: localhost:9000

Django Version: 3.0.8
Python Version: 3.8.4
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes ',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'main.apps.MainConfig']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django .contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback (most recent call last):
File "C:\Users\George \AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\George\AppData\ Local\Programs\Python\Python38\lib\site-packages\django\utils\deprecation.py", line 96, in __call__
response = self.process_response(request, response)
File "C:\Users\George\AppData\Local \Programs\Python\Python38\lib\site-packages\django\middleware\clickjacking.py", line 26,in process_response
if response.get('X-Frame-Options') is not None:

Exception Type: AttributeError at /
Exception Value: 'tuple' object has no attribute 'get'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
dooMoob, 2020-12-11
@dooMoob

TUPLE' OBJECT HAS NO ATTRIBUTE 'GET

D
Denis Melnikov, 2020-12-11
@Mi11er

Maybe it will be clearer

a = (1,2)
a.get(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'get'
>>>

A
Alex Fr, 2020-12-12
@AlexKorstein

Tuple has no get method!!!
This is the dict method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question