'bytes' object has no attribute 'encode'
Request Method: | GET |
---|---|
Request URL: | http://fast-torrent.club/contacts.html |
Django Version: | 4.1.1 |
Exception Type: | AttributeError |
Exception Value: | 'bytes' object has no attribute 'encode' |
Exception Location: | ././film/views.py, line 3488, in content |
Python Executable: | /usr/bin/uwsgi-core |
Python Version: | 3.10.12 |
Python Path: | ['.', '', '/lib/python310.zip', '/lib/python3.10', '/lib/python3.10/lib-dynload', './venv/lib/python3.10/site-packages'] |
Server time: | Tue, 19 Mar 2024 11:39:15 +0000 |
./venv/lib/python3.10/site-packages/django/core/handlers/exception.py
, line 55, in inner
return inner
else:
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | Value |
---|---|
exc | AttributeError("'bytes' object has no attribute 'encode'") |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0>> |
request | <WSGIRequest: GET '/contacts.html'> |
./venv/lib/python3.10/site-packages/django/core/handlers/base.py
, line 197, in _get_response
if response is None:
wrapped_callback = self.make_view_atomic(callback)
# If it is an asynchronous view, run it in a subthread.
if asyncio.iscoroutinefunction(wrapped_callback):
wrapped_callback = async_to_sync(wrapped_callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
if response is None:
raise
# Complain if the view returned None (a common error).
Variable | Value |
---|---|
callback | <function content at 0x7f99a20f7520> |
callback_args | () |
callback_kwargs | {'slug': 'contacts'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>> |
request | <WSGIRequest: GET '/contacts.html'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0> |
wrapped_callback | <function content at 0x7f99a20f7520> |
././film/views.py
, line 3488, in content
if content.is_plain_text:
if content.is_no_header: return HttpResponse( content.full_text )# выводить как текст без заголовков
else: return HttpResponse( content.full_text, content_type='plain/html' )# выводить как текст
uri_key = u"%s-%s-%s" % ( 'content', request.current_site.id, slug )
# уменьшаем длину ключа - чтобы наверняка исключит MemcachedKeyLengthError: Key length is > 250
page_id = md5( uri_key.encode( 'utf-8' ).encode( 'hex' ) )…
d = {'content':content, 'page_id':page_id}
if hasattr( request, 'seo' ): d['seo'] = request.seo
return render(request, 'film/base_content.html', d,)
Variable | Value |
---|---|
content | <Content: 3 : Контакты > |
hid | 38 |
request | <WSGIRequest: GET '/contacts.html'> |
slug | 'contacts' |
uri_key | 'content-1-contacts' |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
CONTENT_LENGTH | '' |
CONTENT_TYPE | '' |
DOCUMENT_ROOT | '/etc/nginx/html' |
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'fast-torrent.club' |
HTTP_REFERER | 'http://www.fast-fiml.ru/contacts.html' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '44.213.99.37' |
HTTP_X_FORWARDED_PROTO | 'http' |
HTTP_X_REAL_IP | '44.213.99.37' |
PATH_INFO | '********************' |
QUERY_STRING | '' |
REMOTE_ADDR | '5.61.59.230' |
REMOTE_PORT | '52130' |
REQUEST_METHOD | 'GET' |
REQUEST_SCHEME | 'http' |
REQUEST_URI | '/contacts.html' |
SCRIPT_NAME | '' |
SERVER_NAME | 'www.fast-torrent.ru' |
SERVER_PORT | '80' |
SERVER_PROTOCOL | 'HTTP/1.0' |
Setting | Value |
---|
You’re seeing this error because you have DEBUG = True
in your
Django settings file. Change that to False
, and Django will
display a standard page generated by the handler for this status code.