(2003, "Can't connect to MySQL server on '127.0.0.1' (111)")
Request Method: | GET |
---|---|
Request URL: | http://chunom.org/pages/?search=%E9%A8%B7%E4%BB%96 |
Django Version: | 2.0 |
Exception Type: | OperationalError |
Exception Value: | (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
Exception Location: | /home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/connections.py in __init__, line 185 |
Python Executable: | /home/trung/venv/nom/bin/python3 |
Python Version: | 3.8.10 |
Python Path: | ['/home/trung/nom', '/home/trung/venv/nom/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/trung/venv/nom/lib/python3.8/site-packages', '/home/tng/nom'] |
Server time: | Tue, 19 Mar 2024 02:19:27 +0100 |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in ensure_connection
"Connection '%s' cannot set TIME_ZONE because its engine "
"handles time zones conversions natively." % self.alias)
def ensure_connection(self):
"""Guarantee that a connection to the database is established."""
if self.connection is None:
with self.wrap_database_errors:
self.connect()...
# ##### Backend-specific wrappers for PEP-249 connection methods #####
def _prepare_cursor(self, cursor):
"""
Validate the connection is usable and perform database cursor wrapping.
Variable | Value |
---|---|
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in connect
# Reset parameters defining when to close the connection
max_age = self.settings_dict['CONN_MAX_AGE']
self.close_at = None if max_age is None else time.time() + max_age
self.closed_in_transaction = False
self.errors_occurred = False
# Establish the connection
conn_params = self.get_connection_params()
self.connection = self.get_new_connection(conn_params)...
self.set_autocommit(self.settings_dict['AUTOCOMMIT'])
self.init_connection_state()
connection_created.send(sender=self.__class__, connection=self)
self.run_on_commit = []
Variable | Value |
---|---|
conn_params | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
max_age | 0 |
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/mysql/base.py
in get_new_connection
', '.join("'%s'" % s for s in sorted(self.isolation_levels))
))
self.isolation_level = isolation_level
kwargs.update(options)
return kwargs
def get_new_connection(self, conn_params):
return Database.connect(**conn_params)...
def init_connection_state(self):
assignments = []
if self.features.is_sql_auto_is_null_enabled:
# SQL_AUTO_IS_NULL controls whether an AUTO_INCREMENT column on
# a recently inserted row will return when the field is tested
Variable | Value |
---|---|
conn_params | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/__init__.py
in Connect
return bytes(x)
def Connect(*args, **kwargs):
"""Factory function for connections.Connection."""
from MySQLdb.connections import Connection
return Connection(*args, **kwargs)...
connect = Connection = Connect
__all__ = [
"BINARY",
Variable | Value |
---|---|
Connection | <class 'MySQLdb.connections.Connection'> |
args | () |
kwargs | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/connections.py
in __init__
client_flag |= CLIENT.MULTI_RESULTS
kwargs2["client_flag"] = client_flag
# PEP-249 requires autocommit to be initially off
autocommit = kwargs2.pop("autocommit", False)
super().__init__(*args, **kwargs2)...
self.cursorclass = cursorclass
self.encoders = {k: v for k, v in conv.items() if type(k) is not int}
# XXX THIS IS GARBAGE: While this is just a garbage and undocumented,
# Django 1.11 depends on it. And they don't fix it because
# they are in security-only fix mode.
Variable | Value |
---|---|
CLIENT | <module 'MySQLdb.constants.CLIENT' from '/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/constants/CLIENT.py'> |
FIELD_TYPE | <module 'MySQLdb.constants.FIELD_TYPE' from '/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/constants/FIELD_TYPE.py'> |
__class__ | <class 'MySQLdb.connections.Connection'> |
_bytes_or_str | ((128, <class 'bytes'>), (None, <class 'str'>)) |
args | () |
autocommit | False |
charset | 'utf8mb4' |
client_flag | 196610 |
client_version | (8, 0) |
conv | {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>} |
conv2 | {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>} |
conversions | {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function TimeDelta_or_None at 0x7f831601f8b0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>} |
cursorclass | <class 'MySQLdb.cursors.Cursor'> |
k | 245 |
kwargs | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
kwargs2 | {'charset': 'utf8mb4', 'client_flag': 196610, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
proxy | <built-in function proxy> |
self | <_mysql.connection open to '(null)' at 0x31fa430> |
sql_mode | '' |
use_unicode | True |
v | <class 'bytes'> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/core/handlers/exception.py
in inner
This decorator is automatically applied to all middleware to ensure that
no middleware leaks an exception and that the next middleware in the stack
can rely on getting a response instead of an exception.
"""
@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 | OperationalError(2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f83156aa430>> |
request | <WSGIRequest: GET '/pages/?search=%E9%A8%B7%E4%BB%96'> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)
except Exception as e:
response = self.process_exception_by_middleware(e, request)...
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
view_name = callback.__name__
else: # CBV
Variable | Value |
---|---|
callback | <function page_home at 0x7f831529d670> |
callback_args | () |
callback_kwargs | {} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f83154ab2e0>> |
request | <WSGIRequest: GET '/pages/?search=%E9%A8%B7%E4%BB%96'> |
resolver | <URLResolver 'nom.urls' (None:None) '^/'> |
resolver_match | ResolverMatch(func=nom.homepage.views.page_home, args=(), kwargs={}, url_name=None, app_names=[], namespaces=[]) |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f83156aa430> |
wrapped_callback | <function page_home at 0x7f831529d670> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)...
except Exception as e:
response = self.process_exception_by_middleware(e, request)
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
Variable | Value |
---|---|
callback | <function page_home at 0x7f831529d670> |
callback_args | () |
callback_kwargs | {} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f83154ab2e0>> |
request | <WSGIRequest: GET '/pages/?search=%E9%A8%B7%E4%BB%96'> |
resolver | <URLResolver 'nom.urls' (None:None) '^/'> |
resolver_match | ResolverMatch(func=nom.homepage.views.page_home, args=(), kwargs={}, url_name=None, app_names=[], namespaces=[]) |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f83156aa430> |
wrapped_callback | <function page_home at 0x7f831529d670> |
/home/trung/nom/nom/homepage/views.py
in page_home
).extra(
select={'frequency':'SELECT MIN(id) FROM wordcounts w WHERE w.word = unihan_reading.reading'}
)
component_search = Glyph.objects.filter(ids__contains=searchtext).order_by('strokes')
# If only one match -> redirect to it
if len(entry_list) + len(glyph_list) + len(component_search) + len(unihan_list) == 1:...
if entry_list and ' ' not in entry_list[0].text:
return redirect('/pages/' + str(entry_list[0].text_nom) + '/')
if glyph_list:
return redirect('/pages/' + str(glyph_list[0].hex()) + '/')
#if component_search:
# return redirect('/pages/' + str(component_search[0].hex()) + '/')
Variable | Value |
---|---|
component_search | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
entry_list | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
glyph_list | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
hex | '9A37' |
q | <Q: (OR: ('text_nom__contains', '騷他'), ('text_nom__exact', '騷他'), ('text__iexact', '騷他'), ('text__iregex', '^騷他[\\s]'), ('text__iregex', '[\\s]騷他$'), ('text__iregex', '[\\s]騷他[\\s]'), ('text_english__iregex', '^騷他[^\\w]'), ('text_english__iregex', '[^\\w]騷他$'), ('text_english__iregex', '[^\\w]騷他[^\\w]'), ('text_english__iexact', '騷他'))> |
request | <WSGIRequest: GET '/pages/?search=%E9%A8%B7%E4%BB%96'> |
s | '騷他' |
search | '騷他' |
searchtext | '騷他' |
unihan_list | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/models/query.py
in __len__
def __repr__(self):
data = list(self[:REPR_OUTPUT_SIZE + 1])
if len(data) > REPR_OUTPUT_SIZE:
data[-1] = "...(remaining elements truncated)..."
return '<%s %r>' % (self.__class__.__name__, data)
def __len__(self):
self._fetch_all()...
return len(self._result_cache)
def __iter__(self):
"""
The queryset iterator protocol uses three nested iterators in the
default case:
Variable | Value |
---|---|
self | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/models/query.py
in _fetch_all
c._known_related_objects = self._known_related_objects
c._iterable_class = self._iterable_class
c._fields = self._fields
return c
def _fetch_all(self):
if self._result_cache is None:
self._result_cache = list(self._iterable_class(self))...
if self._prefetch_related_lookups and not self._prefetch_done:
self._prefetch_related_objects()
def _next_is_sticky(self):
"""
Indicate that the next filter call and the one following that should
Variable | Value |
---|---|
self | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/models/query.py
in __iter__
def __iter__(self):
queryset = self.queryset
db = queryset.db
compiler = queryset.query.get_compiler(using=db)
# Execute the query. This will also fill compiler.select, klass_info,
# and annotations.
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)...
select, klass_info, annotation_col_map = (compiler.select, compiler.klass_info,
compiler.annotation_col_map)
model_cls = klass_info['model']
select_fields = klass_info['select_fields']
model_fields_start, model_fields_end = select_fields[0], select_fields[-1] + 1
init_list = [f[0].target.attname
Variable | Value |
---|---|
compiler | <django.db.backends.mysql.compiler.SQLCompiler object at 0x7f8314890760> |
db | 'default' |
queryset | Error in formatting: OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
self | <django.db.models.query.ModelIterable object at 0x7f8314890fa0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/models/sql/compiler.py
in execute_sql
if result_type == MULTI:
return iter([])
else:
return
if chunked_fetch:
cursor = self.connection.chunked_cursor()
else:
cursor = self.connection.cursor()...
try:
cursor.execute(sql, params)
except Exception:
# Might fail for server-side cursors (e.g. connection closed)
cursor.close()
raise
Variable | Value |
---|---|
chunk_size | 100 |
chunked_fetch | False |
params | ('%騷他%', '騷他', '騷他', '^騷他[\\s]', '[\\s]騷他$', '[\\s]騷他[\\s]', '^騷他[^\\w]', '[^\\w]騷他$', '[^\\w]騷他[^\\w]', '騷他') |
result_type | 'multi' |
self | <django.db.backends.mysql.compiler.SQLCompiler object at 0x7f8314890760> |
sql | ('SELECT (COALESCE((SELECT MIN(wordcounts.frequency) FROM wordcounts WHERE ' "wordcounts.word = entry_entry.text AND wordcounts.specifier IN ('', " 'entry_entry.text_nom) LIMIT 1), 9999999)) AS `frequency`, ' '`entry_entry`.`id`, `entry_entry`.`text_nom`, `entry_entry`.`text`, ' '`entry_entry`.`text_english`, `entry_entry`.`text_vietnamese`, ' '`entry_entry`.`text_german`, `entry_entry`.`search`, `entry_entry`.`notice`, ' '`entry_entry`.`pending`, `entry_entry`.`tags`, `entry_entry`.`word_classes`, ' '`entry_entry`.`tmp_level`, `entry_entry`.`tmp_coverage`, ' '`entry_entry`.`created_by_id`, `entry_entry`.`modified_by_id`, ' '`entry_entry`.`time_created`, `entry_entry`.`last_modified` FROM ' '`entry_entry` WHERE (`entry_entry`.`text_nom` LIKE BINARY %s OR ' '`entry_entry`.`text_nom` = %s OR `entry_entry`.`text` LIKE %s OR ' '`entry_entry`.`text` REGEXP %s OR `entry_entry`.`text` REGEXP %s OR ' '`entry_entry`.`text` REGEXP %s OR `entry_entry`.`text_english` REGEXP %s OR ' '`entry_entry`.`text_english` REGEXP %s OR `entry_entry`.`text_english` ' 'REGEXP %s OR `entry_entry`.`text_english` LIKE %s) ORDER BY `frequency` ASC') |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in cursor
with self.wrap_database_errors:
return self.connection.close()
# ##### Generic wrappers for PEP-249 connection methods #####
def cursor(self):
"""Create a cursor, opening a connection if necessary."""
return self._cursor()...
def commit(self):
"""Commit a transaction and reset the dirty flag."""
self.validate_thread_sharing()
self.validate_no_atomic_block()
self._commit()
Variable | Value |
---|---|
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in _cursor
if self.queries_logged:
wrapped_cursor = self.make_debug_cursor(cursor)
else:
wrapped_cursor = self.make_cursor(cursor)
return wrapped_cursor
def _cursor(self, name=None):
self.ensure_connection()...
with self.wrap_database_errors:
return self._prepare_cursor(self.create_cursor(name))
def _commit(self):
if self.connection is not None:
with self.wrap_database_errors:
Variable | Value |
---|---|
name | None |
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in ensure_connection
"Connection '%s' cannot set TIME_ZONE because its engine "
"handles time zones conversions natively." % self.alias)
def ensure_connection(self):
"""Guarantee that a connection to the database is established."""
if self.connection is None:
with self.wrap_database_errors:
self.connect()...
# ##### Backend-specific wrappers for PEP-249 connection methods #####
def _prepare_cursor(self, cursor):
"""
Validate the connection is usable and perform database cursor wrapping.
Variable | Value |
---|---|
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/utils.py
in __exit__
db_exc_type = getattr(self.wrapper.Database, dj_exc_type.__name__)
if issubclass(exc_type, db_exc_type):
dj_exc_value = dj_exc_type(*exc_value.args)
# Only set the 'errors_occurred' flag for errors that may make
# the connection unusable.
if dj_exc_type not in (DataError, IntegrityError):
self.wrapper.errors_occurred = True
raise dj_exc_value.with_traceback(traceback) from exc_value...
def __call__(self, func):
# Note that we are intentionally not using @wraps here for performance
# reasons. Refs #21109.
def inner(*args, **kwargs):
with self:
Variable | Value |
---|---|
db_exc_type | <class 'MySQLdb._exceptions.OperationalError'> |
dj_exc_type | <class 'django.db.utils.OperationalError'> |
dj_exc_value | OperationalError(2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
exc_type | <class 'MySQLdb._exceptions.OperationalError'> |
exc_value | OperationalError(2003, "Can't connect to MySQL server on '127.0.0.1' (111)") |
self | <django.db.utils.DatabaseErrorWrapper object at 0x7f8314d0e490> |
traceback | <traceback object at 0x7f8314b923c0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in ensure_connection
"Connection '%s' cannot set TIME_ZONE because its engine "
"handles time zones conversions natively." % self.alias)
def ensure_connection(self):
"""Guarantee that a connection to the database is established."""
if self.connection is None:
with self.wrap_database_errors:
self.connect()...
# ##### Backend-specific wrappers for PEP-249 connection methods #####
def _prepare_cursor(self, cursor):
"""
Validate the connection is usable and perform database cursor wrapping.
Variable | Value |
---|---|
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/base/base.py
in connect
# Reset parameters defining when to close the connection
max_age = self.settings_dict['CONN_MAX_AGE']
self.close_at = None if max_age is None else time.time() + max_age
self.closed_in_transaction = False
self.errors_occurred = False
# Establish the connection
conn_params = self.get_connection_params()
self.connection = self.get_new_connection(conn_params)...
self.set_autocommit(self.settings_dict['AUTOCOMMIT'])
self.init_connection_state()
connection_created.send(sender=self.__class__, connection=self)
self.run_on_commit = []
Variable | Value |
---|---|
conn_params | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
max_age | 0 |
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/django/db/backends/mysql/base.py
in get_new_connection
', '.join("'%s'" % s for s in sorted(self.isolation_levels))
))
self.isolation_level = isolation_level
kwargs.update(options)
return kwargs
def get_new_connection(self, conn_params):
return Database.connect(**conn_params)...
def init_connection_state(self):
assignments = []
if self.features.is_sql_auto_is_null_enabled:
# SQL_AUTO_IS_NULL controls whether an AUTO_INCREMENT column on
# a recently inserted row will return when the field is tested
Variable | Value |
---|---|
conn_params | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
self | <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f83160743d0> |
/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/__init__.py
in Connect
return bytes(x)
def Connect(*args, **kwargs):
"""Factory function for connections.Connection."""
from MySQLdb.connections import Connection
return Connection(*args, **kwargs)...
connect = Connection = Connect
__all__ = [
"BINARY",
Variable | Value |
---|---|
Connection | <class 'MySQLdb.connections.Connection'> |
args | () |
kwargs | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/connections.py
in __init__
client_flag |= CLIENT.MULTI_RESULTS
kwargs2["client_flag"] = client_flag
# PEP-249 requires autocommit to be initially off
autocommit = kwargs2.pop("autocommit", False)
super().__init__(*args, **kwargs2)...
self.cursorclass = cursorclass
self.encoders = {k: v for k, v in conv.items() if type(k) is not int}
# XXX THIS IS GARBAGE: While this is just a garbage and undocumented,
# Django 1.11 depends on it. And they don't fix it because
# they are in security-only fix mode.
Variable | Value |
---|---|
CLIENT | <module 'MySQLdb.constants.CLIENT' from '/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/constants/CLIENT.py'> |
FIELD_TYPE | <module 'MySQLdb.constants.FIELD_TYPE' from '/home/trung/venv/nom/lib/python3.8/site-packages/MySQLdb/constants/FIELD_TYPE.py'> |
__class__ | <class 'MySQLdb.connections.Connection'> |
_bytes_or_str | ((128, <class 'bytes'>), (None, <class 'str'>)) |
args | () |
autocommit | False |
charset | 'utf8mb4' |
client_flag | 196610 |
client_version | (8, 0) |
conv | {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>} |
conv2 | {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>} |
conversions | {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function TimeDelta_or_None at 0x7f831601f8b0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>} |
cursorclass | <class 'MySQLdb.cursors.Cursor'> |
k | 245 |
kwargs | {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
kwargs2 | {'charset': 'utf8mb4', 'client_flag': 196610, 'conv': {0: <class 'decimal.Decimal'>, 1: <class 'int'>, 2: <class 'int'>, 3: <class 'int'>, 4: <class 'float'>, 5: <class 'float'>, 7: <function DateTime_or_None at 0x7f831601f820>, 8: <class 'int'>, 9: <class 'int'>, 10: <function Date_or_None at 0x7f831601f9d0>, 11: <function typecast_time at 0x7f831661e9d0>, 12: <function DateTime_or_None at 0x7f831601f820>, 13: <class 'int'>, 15: <class 'bytes'>, 245: <class 'bytes'>, 246: <class 'decimal.Decimal'>, 249: <class 'bytes'>, 250: <class 'bytes'>, 251: <class 'bytes'>, 252: <class 'bytes'>, 253: <class 'bytes'>, 254: <class 'bytes'>, <class 'set'>: <function Set2Str at 0x7f831602a040>, <class 'NoneType'>: <function None2NULL at 0x7f831602a1f0>, <class 'bool'>: <function Bool2Str at 0x7f831601ff70>, <class 'float'>: <function Float2Str at 0x7f831602a160>, <class 'array.array'>: <function array2Str at 0x7f831602a3a0>, <class 'int'>: <function Thing2Str at 0x7f831602a0d0>, <class 'datetime.timedelta'>: <function DateTimeDelta2literal at 0x7f831601faf0>, <class 'datetime.datetime'>: <function DateTime2literal at 0x7f831601fa60>, <class 'datetime.date'>: <function Thing2Literal at 0x7f831602a280>, <class 'decimal.Decimal'>: <function Decimal2Literal at 0x7f831602a310>}, 'db': 'www_chunom_org', 'host': '127.0.0.1', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'passwd': '12345', 'port': 3306, 'user': 'www_chunom_org'} |
proxy | <built-in function proxy> |
self | <_mysql.connection open to '(null)' at 0x31fa430> |
sql_mode | '' |
use_unicode | True |
v | <class 'bytes'> |
AnonymousUser
Variable | Value |
---|---|
search | '騷他' |
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'chunom.org' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '54.160.244.62' |
PATH_INFO | '/pages/' |
QUERY_STRING | 'search=%E9%A8%B7%E4%BB%96' |
RAW_URI | '/pages/?search=%E9%A8%B7%E4%BB%96' |
REMOTE_ADDR | '' |
REQUEST_METHOD | 'GET' |
SCRIPT_NAME | '' |
SERVER_NAME | 'chunom.org' |
SERVER_PORT | '80' |
SERVER_PROTOCOL | 'HTTP/1.0' |
SERVER_SOFTWARE | 'gunicorn/20.1.0' |
gunicorn.socket | <socket.socket fd=10, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=/home/trung/nom/gunicorn.sock> |
wsgi.errors | <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f8314bdc0a0> |
wsgi.file_wrapper | '' |
wsgi.input | <gunicorn.http.body.Body object at 0x7f8314bdcfa0> |
wsgi.input_terminated | True |
wsgi.multiprocess | True |
wsgi.multithread | False |
wsgi.run_once | False |
wsgi.url_scheme | 'http' |
wsgi.version | (1, 0) |
settings_live
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | {} |
ADMINS | (('Trung Nguyen', 'qt.nguyen@sevenmicro.de'),) |
ADMIN_MEDIA_PREFIX | '/static/media/' |
ALLOWED_HOSTS | ['*'] |
APPEND_SLASH | True |
AUTHENTICATION_BACKENDS | ('social_core.backends.google.GoogleOAuth2', 'social_core.backends.facebook.FacebookOAuth2', 'social_core.backends.twitter.TwitterOAuth', 'django.contrib.auth.backends.ModelBackend') |
AUTH_PASSWORD_VALIDATORS | '********************' |
AUTH_USER_MODEL | 'auth.User' |
BASE_DIR | '/home/trung/nom' |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} |
CACHE_MIDDLEWARE_ALIAS | 'default' |
CACHE_MIDDLEWARE_KEY_PREFIX | '********************' |
CACHE_MIDDLEWARE_SECONDS | 600 |
CORS_ALLOW_CREDENTIALS | True |
CORS_ORIGIN_ALLOW_ALL | True |
CSRF_COOKIE_AGE | 31449600 |
CSRF_COOKIE_DOMAIN | None |
CSRF_COOKIE_HTTPONLY | False |
CSRF_COOKIE_NAME | 'csrftoken' |
CSRF_COOKIE_PATH | '/' |
CSRF_COOKIE_SECURE | False |
CSRF_FAILURE_VIEW | 'django.views.csrf.csrf_failure' |
CSRF_HEADER_NAME | 'HTTP_X_CTOKEN' |
CSRF_TRUSTED_ORIGINS | [] |
CSRF_USE_SESSIONS | False |
DATABASES | {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.mysql', 'HOST': '127.0.0.1', 'NAME': 'www_chunom_org', 'OPTIONS': {'charset': 'utf8mb4', 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'isolation_level': 'read committed'}, 'PASSWORD': '********************', 'PORT': '3306', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'www_chunom_org'}, 'sqlite': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.sqlite3', 'HOST': '127.0.0.1', 'NAME': '/home/trung/nom/nom.live', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '3306', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'nom'}} |
DATABASE_ROUTERS | [] |
DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 |
DATETIME_FORMAT | 'N j, Y, P' |
DATETIME_INPUT_FORMATS | ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/%d/%y'] |
DATE_FORMAT | 'N j, Y' |
DATE_INPUT_FORMATS | ['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y'] |
DEBUG | True |
DEBUG_PROPAGATE_EXCEPTIONS | False |
DECIMAL_SEPARATOR | '.' |
DEFAULT_CHARSET | 'utf-8' |
DEFAULT_CONTENT_TYPE | 'text/html' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
DEFAULT_FILE_STORAGE | 'django.core.files.storage.FileSystemStorage' |
DEFAULT_FROM_EMAIL | 'notify@chunom.org' |
DEFAULT_INDEX_TABLESPACE | '' |
DEFAULT_TABLESPACE | '' |
DISALLOWED_USER_AGENTS | [] |
DJANGO_BASE | '/home/trung/nom/' |
DJANGO_ROOT | '/home/trung/nom/nom/' |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
EMAIL_HOST | 'smtp.chunom.org' |
EMAIL_HOST_PASSWORD | '********************' |
EMAIL_HOST_USER | 'qt.nguyen@sevenmicro.com' |
EMAIL_PORT | 25 |
EMAIL_SSL_CERTFILE | None |
EMAIL_SSL_KEYFILE | '********************' |
EMAIL_SUBJECT_PREFIX | '[Django] ' |
EMAIL_TIMEOUT | None |
EMAIL_USE_LOCALTIME | False |
EMAIL_USE_SSL | False |
EMAIL_USE_TLS | False |
FILE_CHARSET | 'utf-8' |
FILE_UPLOAD_DIRECTORY_PERMISSIONS | None |
FILE_UPLOAD_HANDLERS | ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] |
FILE_UPLOAD_MAX_MEMORY_SIZE | 10485760 |
FILE_UPLOAD_PERMISSIONS | None |
FILE_UPLOAD_TEMP_DIR | None |
FIRST_DAY_OF_WEEK | 0 |
FIXTURE_DIRS | [] |
FORCE_SCRIPT_NAME | None |
FORMAT_MODULE_PATH | None |
FORM_RENDERER | 'django.forms.renderers.DjangoTemplates' |
IGNORABLE_404_URLS | [] |
INSTALLED_APPS | ('whitenoise.runserver_nostatic', 'django.contrib.staticfiles', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'corsheaders', 'django_markdownfield', 'nom.compose', 'nom.converter', 'nom.discuss', 'nom.document', 'nom.entry', 'nom.forum', 'nom.glyph', 'nom.homepage', 'nom.ime', 'nom.level', 'nom.blog', 'nom.samples', 'nom.shelf', 'nom.sheet', 'nom.timeline', 'nom.unihan', 'social_django') |
INTERNAL_IPS | [] |
LANGUAGES | (('en', 'English'), ('vi', 'Vietnamese'), ('de', 'German'), ('vi-xx', 'Chu Nom')) |
LANGUAGES_BIDI | ['he', 'ar', 'fa', 'ur'] |
LANGUAGE_CODE | 'en' |
LANGUAGE_COOKIE_AGE | None |
LANGUAGE_COOKIE_DOMAIN | None |
LANGUAGE_COOKIE_NAME | 'django_language' |
LANGUAGE_COOKIE_PATH | '/' |
LOCALE_PATHS | ('/home/trung/nom/nom/locale',) |
LOGGING | {'disable_existing_loggers': True, 'formatters': {'simple': {'format': '%(levelname)s %(asctime)s %(module)s ' 'Line %(lineno)d: %(message)s'}, 'verbose': {'format': '%(levelname)s %(asctime)s %(module)s ' 'Line %(lineno)d: %(process)d %(thread)d ' '%(message)s'}}, 'handlers': {'console': {'class': 'logging.StreamHandler', 'formatter': 'simple', 'level': 'DEBUG'}, 'file': {'backupCount': 2, 'class': 'logging.handlers.RotatingFileHandler', 'filename': '/home/trung/nom/nom/logging.log', 'formatter': 'simple', 'level': 'DEBUG', 'maxBytes': 50000}, 'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'formatter': 'simple', 'level': 'ERROR'}}, 'loggers': {'': {'handlers': ['file', 'console'], 'level': 'ERROR', 'propagate': True}}, 'version': 1} |
LOGGING_CONFIG | 'logging.config.dictConfig' |
LOGIN_REDIRECT_URL | '/' |
LOGIN_URL | '/login/' |
LOGOUT_REDIRECT_URL | '/' |
LOGOUT_URL | '/logout/' |
MANAGERS | (('Trung Nguyen', 'qt.nguyen@sevenmicro.de'),) |
MARKDOWNX_EDITOR_RESIZABLE | False |
MARKDOWNX_IMAGE_MAX_SIZE | {'quality': 90, 'size': (800, 600)} |
MARKDOWNX_MARKDOWN_EXTENSIONS | ['markdown.extensions.extra'] |
MARKDOWNX_MEDIA_PATH | 'md-img/2024/03' |
MEDIA_ROOT | '/home/trung/nom/nom/_upload/' |
MEDIA_URL | '/upload/' |
MESSAGE_STORAGE | 'django.contrib.messages.storage.fallback.FallbackStorage' |
MIDDLEWARE | ('django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'social_django.middleware.SocialAuthExceptionMiddleware') |
MIDDLEWARE_CLASSES | ('django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'social_django.middleware.SocialAuthExceptionMiddleware') |
MIGRATION_MODULES | {} |
MONTH_DAY_FORMAT | 'F j' |
NUMBER_GROUPING | 0 |
PASSWORD_HASHERS | '********************' |
PASSWORD_RESET_TIMEOUT_DAYS | '********************' |
PREPEND_WWW | False |
ROOT_URLCONF | 'nom.urls' |
SECRET_KEY | '********************' |
SECURE_BROWSER_XSS_FILTER | False |
SECURE_CONTENT_TYPE_NOSNIFF | False |
SECURE_HSTS_INCLUDE_SUBDOMAINS | False |
SECURE_HSTS_PRELOAD | False |
SECURE_HSTS_SECONDS | 0 |
SECURE_PROXY_SSL_HEADER | None |
SECURE_REDIRECT_EXEMPT | [] |
SECURE_SSL_HOST | None |
SECURE_SSL_REDIRECT | False |
SEND_BROKEN_LINK_EMAILS | False |
SERVER_EMAIL | 'root@localhost' |
SESSION_CACHE_ALIAS | 'default' |
SESSION_COOKIE_AGE | 7776000 |
SESSION_COOKIE_DOMAIN | None |
SESSION_COOKIE_HTTPONLY | True |
SESSION_COOKIE_NAME | 'sessionid' |
SESSION_COOKIE_PATH | '/' |
SESSION_COOKIE_SECURE | False |
SESSION_ENGINE | 'django.contrib.sessions.backends.db' |
SESSION_EXPIRE_AT_BROWSER_CLOSE | False |
SESSION_FILE_PATH | None |
SESSION_SAVE_EVERY_REQUEST | False |
SESSION_SERIALIZER | 'django.contrib.sessions.serializers.JSONSerializer' |
SETTINGS_MODULE | 'settings_live' |
SHORT_DATETIME_FORMAT | 'm/d/Y P' |
SHORT_DATE_FORMAT | 'm/d/Y' |
SIGNING_BACKEND | 'django.core.signing.TimestampSigner' |
SILENCED_SYSTEM_CHECKS | [] |
SITE_ID | 1 |
SOCIAL_AUTH_FACEBOOK_KEY | '********************' |
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS | {'fields': 'id,name,email,age_range'} |
SOCIAL_AUTH_FACEBOOK_SCOPE | ['email'] |
SOCIAL_AUTH_FACEBOOK_SECRET | '********************' |
SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS | {'access_type': 'offline', 'approval_prompt': 'auto'} |
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY | '********************' |
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET | '********************' |
SOCIAL_AUTH_LOGIN_ERROR_URL | '/' |
SOCIAL_AUTH_PIPELINE | ('social_core.pipeline.social_auth.social_details', 'social_core.pipeline.social_auth.social_uid', 'social_core.pipeline.social_auth.auth_allowed', 'social_core.pipeline.social_auth.social_user', 'social_core.pipeline.user.get_username', 'social_core.pipeline.social_auth.associate_by_email', 'social_core.pipeline.user.create_user', 'social_core.pipeline.social_auth.associate_user', 'social_core.pipeline.social_auth.load_extra_data', 'social_core.pipeline.user.user_details') |
SOCIAL_AUTH_TWITTER_KEY | '********************' |
SOCIAL_AUTH_TWITTER_SECRET | '********************' |
SOUTH_DATABASE_ADAPTERS | {'default': 'south.db.sqlite3'} |
STATICFILES_DIRS | ('/home/trung/nom/media',) |
STATICFILES_FINDERS | ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
STATIC_ROOT | '/home/trung/nom/nom/_media/' |
STATIC_URL | '/media/' |
TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/home/trung/nom/nom/templates/'], 'OPTIONS': {'builtins': ['nom.glyph.templatetags.projectfilters'], 'context_processors': ['django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.debug', 'django.contrib.messages.context_processors.messages', 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.i18n', 'nom.context_processors.variables', 'django.template.context_processors.request', 'django.template.context_processors.tz', 'social_django.context_processors.backends', 'social_django.context_processors.login_redirect']}}] |
TEST_NON_SERIALIZED_APPS | [] |
TEST_RUNNER | 'django.test.runner.DiscoverRunner' |
THOUSAND_SEPARATOR | ',' |
TIME_FORMAT | 'P' |
TIME_INPUT_FORMATS | ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] |
TIME_ZONE | 'Europe/Berlin' |
USE_ETAGS | False |
USE_I18N | True |
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
USE_TZ | False |
USE_X_FORWARDED_HOST | False |
USE_X_FORWARDED_PORT | False |
WSGI_APPLICATION | None |
X_FRAME_OPTIONS | 'SAMEORIGIN' |
YEAR_MONTH_FORMAT | 'F Y' |
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.