简体   繁体   中英

AttributeError at / 'tuple' object has no attribute 'get' in Django

I am having a AttributeError at / 'tuple' object has no attribute 'get', below is the trace path what could be wrong in Django?

AttributeError at /

'tuple' object has no attribute 'get'

Request Method:     GET
Request URL:    http://www.example.com/
Django Version:     1.10.5
Exception Type:     AttributeError
Exception Value:    

'tuple' object has no attribute 'get'

Exception Location:     /home/admin/env/lib/python3.5/site-packages     /django/middleware/clickjacking.py in process_response, line 32

Python Executable: /home/admin/env/bin/python Python Version: 3.5.2

The clickjacking middleware is calling the response's get method. Hence, your view is not returning a HttpResponse instance.

check the applications views.py file, something is wrong with render or HttpResopose function in return statement. I was getting same error and I was missing render in my return statement.

def relative(request): return render(request, 'basic_app/relative_url_templates.html')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM