could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory
Request Method: | GET |
---|---|
Request URL: | http://tccnqp.vn/article/1271/oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac |
Django Version: | 3.0.3 |
Exception Type: | OperationalError |
Exception Value: | could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
Exception Location: | /home/vdi/sources/vdi/venv/lib64/python3.6/site-packages/psycopg2/__init__.py in connect, line 126 |
Python Executable: | /home/vdi/sources/vdi/venv/bin/python |
Python Version: | 3.6.8 |
Python Path: | ['/home/vdi/sources/vdi', '/usr/lib64/python36.zip', '/usr/lib64/python3.6', '/usr/lib64/python3.6/lib-dynload', '/home/vdi/sources/vdi/venv/lib64/python3.6/site-packages', '/home/vdi/sources/vdi/venv/lib/python3.6/site-packages', '/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django_imagefit-0.6.2-py3.6.egg', '/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django_appconf-1.0.4-py3.6.egg'] |
Server time: | Thu, 28 Mar 2024 18:35:23 +0700 |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/backends/base/base.py
in ensure_connection
"handles time zones conversions natively." % self.alias)
@async_unsafe
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.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/utils/asyncio.py
in inner
event_loop = asyncio.get_event_loop()
except RuntimeError:
pass
else:
if event_loop.is_running():
raise SynchronousOnlyOperation(message)
# Pass onwards.
return func(*args, **kwargs)…
return inner
# If the message is actually a function, then be a no-arguments decorator.
if callable(message):
func = message
message = 'You cannot call this from an async context - use a thread or sync_to_async.'
return decorator(func)
Variable | Value |
---|---|
args | (<django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60>,) |
func | <function BaseDatabaseWrapper.connect at 0x7fed16f01c80> |
kwargs | {} |
message | 'You cannot call this from an async context - use a thread or sync_to_async.' |
/home/vdi/sources/vdi/venv/lib/python3.6/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.monotonic() + 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 | {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'} |
max_age | 0 |
self | <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/utils/asyncio.py
in inner
event_loop = asyncio.get_event_loop()
except RuntimeError:
pass
else:
if event_loop.is_running():
raise SynchronousOnlyOperation(message)
# Pass onwards.
return func(*args, **kwargs)…
return inner
# If the message is actually a function, then be a no-arguments decorator.
if callable(message):
func = message
message = 'You cannot call this from an async context - use a thread or sync_to_async.'
return decorator(func)
Variable | Value |
---|---|
args | (<django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60>, {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'}) |
func | <function DatabaseWrapper.get_new_connection at 0x7fed14755158> |
kwargs | {} |
message | 'You cannot call this from an async context - use a thread or sync_to_async.' |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/backends/postgresql/base.py
in get_new_connection
conn_params['host'] = settings_dict['HOST']
if settings_dict['PORT']:
conn_params['port'] = settings_dict['PORT']
return conn_params
@async_unsafe
def get_new_connection(self, conn_params):
connection = Database.connect(**conn_params)…
# self.isolation_level must be set:
# - after connecting to the database in order to obtain the database's
# default when no value is explicitly specified in options.
# - before calling _set_autocommit() because if autocommit is on, that
# will set connection.isolation_level to ISOLATION_LEVEL_AUTOCOMMIT.
Variable | Value |
---|---|
conn_params | {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'} |
self | <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib64/python3.6/site-packages/psycopg2/__init__.py
in connect
if 'async_' in kwargs:
kwasync['async_'] = kwargs.pop('async_')
if dsn is None and not kwargs:
raise TypeError('missing dsn and no parameters')
dsn = _ext.make_dsn(dsn, **kwargs)
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)…
if cursor_factory is not None:
conn.cursor_factory = cursor_factory
return conn
Variable | Value |
---|---|
connection_factory | None |
cursor_factory | None |
dsn | 'user=vdi password=vdi@123 host=localhost port=5432 dbname=vdi_0705' |
kwargs | {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'} |
kwasync | {} |
/home/vdi/sources/vdi/venv/lib/python3.6/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('could not fork new process for connection: Cannot allocate memory\n\ncould not fork new process for connection: Cannot allocate memory\n',) |
get_response | <bound method BaseHandler._get_response of <channels.http.AsgiHandler object at 0x7fed12488f28>> |
request | <AsgiRequest: GET '/article/1271/oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'> |
/home/vdi/sources/vdi/venv/lib/python3.6/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 article_view at 0x7fed13b799d8> |
callback_args | () |
callback_kwargs | {'id': 1271, 'slug': 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7fed123d31d0>> |
request | <AsgiRequest: GET '/article/1271/oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'> |
resolver | <URLResolver 'news.urls' (None:None) '^/'> |
resolver_match | ResolverMatch(func=news.views.article.article_view, args=(), kwargs={'id': 1271, 'slug': 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'}, url_name=article, app_names=[], namespaces=[], route=article/<int:id>/<str:slug>) |
response | None |
self | <channels.http.AsgiHandler object at 0x7fed12488f28> |
wrapped_callback | <function article_view at 0x7fed13b799d8> |
/home/vdi/sources/vdi/venv/lib/python3.6/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 article_view at 0x7fed13b799d8> |
callback_args | () |
callback_kwargs | {'id': 1271, 'slug': 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7fed123d31d0>> |
request | <AsgiRequest: GET '/article/1271/oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'> |
resolver | <URLResolver 'news.urls' (None:None) '^/'> |
resolver_match | ResolverMatch(func=news.views.article.article_view, args=(), kwargs={'id': 1271, 'slug': 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'}, url_name=article, app_names=[], namespaces=[], route=article/<int:id>/<str:slug>) |
response | None |
self | <channels.http.AsgiHandler object at 0x7fed12488f28> |
wrapped_callback | <function article_view at 0x7fed13b799d8> |
/home/vdi/sources/vdi/news/views/article.py
in article_view
from management.models.intro_article import IntroArticle
from management.models.article_category import ArticleCategory
from .base_view import base_view
from .sendmail import sendmail
def article_view(request, id=None, slug=None):
article = get_object_or_404(Article, pk=id, slug=slug)…
if request.POST:
data = {
"Họ và tên": request.POST.get('name'),
"Đơn vị": request.POST.get('factory'),
"Điện Thoại": request.POST.get('phone'),
"Email": request.POST.get('email'),
Variable | Value |
---|---|
id | 1271 |
request | <AsgiRequest: GET '/article/1271/oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'> |
slug | 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac' |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/shortcuts.py
in get_object_or_404
if not hasattr(queryset, 'get'):
klass__name = klass.__name__ if isinstance(klass, type) else klass.__class__.__name__
raise ValueError(
"First argument to get_object_or_404() must be a Model, Manager, "
"or QuerySet, not '%s'." % klass__name
)
try:
return queryset.get(*args, **kwargs)…
except queryset.model.DoesNotExist:
raise Http404('No %s matches the given query.' % queryset.model._meta.object_name)
def get_list_or_404(klass, *args, **kwargs):
"""
Variable | Value |
---|---|
args | () |
klass | <class 'management.models.article.Article'> |
kwargs | {'pk': 1271, 'slug': 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'} |
queryset | Error in formatting: OperationalError: could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/models/query.py
in get
clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs)
if self.query.can_filter() and not self.query.distinct_fields:
clone = clone.order_by()
limit = None
if not clone.query.select_for_update or connections[clone.db].features.supports_select_for_update_with_limit:
limit = MAX_GET_RESULTS
clone.query.set_limits(high=limit)
num = len(clone)…
if num == 1:
return clone._result_cache[0]
if not num:
raise self.model.DoesNotExist(
"%s matching query does not exist." %
self.model._meta.object_name
Variable | Value |
---|---|
args | () |
clone | Error in formatting: OperationalError: could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
kwargs | {'pk': 1271, 'slug': 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac'} |
limit | 21 |
self | Error in formatting: OperationalError: could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
/home/vdi/sources/vdi/venv/lib/python3.6/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: could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
/home/vdi/sources/vdi/venv/lib/python3.6/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: could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
/home/vdi/sources/vdi/venv/lib/python3.6/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.models.sql.compiler.SQLCompiler object at 0x7fecff9dd710> |
db | 'default' |
queryset | Error in formatting: OperationalError: could not fork new process for connection: Cannot allocate memory could not fork new process for connection: Cannot allocate memory |
self | <django.db.models.query.ModelIterable object at 0x7fecff9dd898> |
/home/vdi/sources/vdi/venv/lib/python3.6/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 | (1271, 'oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac') |
result_type | 'multi' |
self | <django.db.models.sql.compiler.SQLCompiler object at 0x7fecff9dd710> |
sql | ('SELECT "management_article"."id", "management_article"."author_id", ' '"management_article"."category_id_id", "management_article"."title", ' '"management_article"."sub_title", "management_article"."content", ' '"management_article"."created_date", "management_article"."publish_date", ' '"management_article"."article_image", "management_article"."state", ' '"management_article"."is_feature", "management_article"."slug" FROM ' '"management_article" WHERE ("management_article"."id" = %s AND ' '"management_article"."slug" = %s) LIMIT 21') |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/utils/asyncio.py
in inner
event_loop = asyncio.get_event_loop()
except RuntimeError:
pass
else:
if event_loop.is_running():
raise SynchronousOnlyOperation(message)
# Pass onwards.
return func(*args, **kwargs)…
return inner
# If the message is actually a function, then be a no-arguments decorator.
if callable(message):
func = message
message = 'You cannot call this from an async context - use a thread or sync_to_async.'
return decorator(func)
Variable | Value |
---|---|
args | (<django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60>,) |
func | <function BaseDatabaseWrapper.cursor at 0x7fed16f15268> |
kwargs | {} |
message | 'You cannot call this from an async context - use a thread or sync_to_async.' |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/backends/base/base.py
in cursor
return self.connection.close()
# ##### Generic wrappers for PEP-249 connection methods #####
@async_unsafe
def cursor(self):
"""Create a cursor, opening a connection if necessary."""
return self._cursor()…
@async_unsafe
def commit(self):
"""Commit a transaction and reset the dirty flag."""
self.validate_thread_sharing()
self.validate_no_atomic_block()
Variable | Value |
---|---|
self | <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/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.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/utils/asyncio.py
in inner
event_loop = asyncio.get_event_loop()
except RuntimeError:
pass
else:
if event_loop.is_running():
raise SynchronousOnlyOperation(message)
# Pass onwards.
return func(*args, **kwargs)…
return inner
# If the message is actually a function, then be a no-arguments decorator.
if callable(message):
func = message
message = 'You cannot call this from an async context - use a thread or sync_to_async.'
return decorator(func)
Variable | Value |
---|---|
args | (<django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60>,) |
func | <function BaseDatabaseWrapper.ensure_connection at 0x7fed16f01e18> |
kwargs | {} |
message | 'You cannot call this from an async context - use a thread or sync_to_async.' |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/backends/base/base.py
in ensure_connection
"handles time zones conversions natively." % self.alias)
@async_unsafe
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.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/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 'psycopg2.OperationalError'> |
dj_exc_type | <class 'django.db.utils.OperationalError'> |
dj_exc_value | OperationalError('could not fork new process for connection: Cannot allocate memory\n\ncould not fork new process for connection: Cannot allocate memory\n',) |
exc_type | <class 'psycopg2.OperationalError'> |
exc_value | OperationalError('could not fork new process for connection: Cannot allocate memory\n\ncould not fork new process for connection: Cannot allocate memory\n',) |
self | <django.db.utils.DatabaseErrorWrapper object at 0x7fecff9dd4e0> |
traceback | <traceback object at 0x7fecfed2cf88> |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/backends/base/base.py
in ensure_connection
"handles time zones conversions natively." % self.alias)
@async_unsafe
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.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/utils/asyncio.py
in inner
event_loop = asyncio.get_event_loop()
except RuntimeError:
pass
else:
if event_loop.is_running():
raise SynchronousOnlyOperation(message)
# Pass onwards.
return func(*args, **kwargs)…
return inner
# If the message is actually a function, then be a no-arguments decorator.
if callable(message):
func = message
message = 'You cannot call this from an async context - use a thread or sync_to_async.'
return decorator(func)
Variable | Value |
---|---|
args | (<django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60>,) |
func | <function BaseDatabaseWrapper.connect at 0x7fed16f01c80> |
kwargs | {} |
message | 'You cannot call this from an async context - use a thread or sync_to_async.' |
/home/vdi/sources/vdi/venv/lib/python3.6/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.monotonic() + 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 | {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'} |
max_age | 0 |
self | <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/utils/asyncio.py
in inner
event_loop = asyncio.get_event_loop()
except RuntimeError:
pass
else:
if event_loop.is_running():
raise SynchronousOnlyOperation(message)
# Pass onwards.
return func(*args, **kwargs)…
return inner
# If the message is actually a function, then be a no-arguments decorator.
if callable(message):
func = message
message = 'You cannot call this from an async context - use a thread or sync_to_async.'
return decorator(func)
Variable | Value |
---|---|
args | (<django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60>, {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'}) |
func | <function DatabaseWrapper.get_new_connection at 0x7fed14755158> |
kwargs | {} |
message | 'You cannot call this from an async context - use a thread or sync_to_async.' |
/home/vdi/sources/vdi/venv/lib/python3.6/site-packages/django/db/backends/postgresql/base.py
in get_new_connection
conn_params['host'] = settings_dict['HOST']
if settings_dict['PORT']:
conn_params['port'] = settings_dict['PORT']
return conn_params
@async_unsafe
def get_new_connection(self, conn_params):
connection = Database.connect(**conn_params)…
# self.isolation_level must be set:
# - after connecting to the database in order to obtain the database's
# default when no value is explicitly specified in options.
# - before calling _set_autocommit() because if autocommit is on, that
# will set connection.isolation_level to ISOLATION_LEVEL_AUTOCOMMIT.
Variable | Value |
---|---|
conn_params | {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'} |
self | <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fecf5cd0f60> |
/home/vdi/sources/vdi/venv/lib64/python3.6/site-packages/psycopg2/__init__.py
in connect
if 'async_' in kwargs:
kwasync['async_'] = kwargs.pop('async_')
if dsn is None and not kwargs:
raise TypeError('missing dsn and no parameters')
dsn = _ext.make_dsn(dsn, **kwargs)
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)…
if cursor_factory is not None:
conn.cursor_factory = cursor_factory
return conn
Variable | Value |
---|---|
connection_factory | None |
cursor_factory | None |
dsn | 'user=vdi password=vdi@123 host=localhost port=5432 dbname=vdi_0705' |
kwargs | {'database': 'vdi_0705', 'host': 'localhost', 'password': 'vdi@123', 'port': '5432', 'user': 'vdi'} |
kwasync | {} |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'tccnqp.vn' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '52.54.111.228' |
HTTP_X_FORWARDED_PROTO | 'http' |
HTTP_X_REAL_IP | '52.54.111.228' |
PATH_INFO | '/article/1271/oi-moi-hoat-ong-cong-tac-ang-cong-tac-chinh-tri-theo-huong-hieu-qua-thiet-thuc-vung-chac' |
QUERY_STRING | '' |
REMOTE_ADDR | '127.0.0.1' |
REMOTE_HOST | '127.0.0.1' |
REMOTE_PORT | 40142 |
REQUEST_METHOD | 'GET' |
SCRIPT_NAME | '' |
SERVER_NAME | '127.0.0.1' |
SERVER_PORT | '8000' |
wsgi.multiprocess | True |
wsgi.multithread | True |
news.settings
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | {} |
ADMINS | [] |
ADMIN_EMAIL | 'duongthanhlong93@gmail.com' |
ALLOWED_HOSTS | ['171.244.49.82', 'cnqp.com.vn', 'tccnqp.vn', 'localhost', '127.0.0.1', 'vdi.org.vn'] |
APPEND_SLASH | True |
ASGI_APPLICATION | 'news.routing.application' |
AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] |
AUTH_PASSWORD_VALIDATORS | '********************' |
AUTH_USER_MODEL | 'management.MyUser' |
BASE_DIR | '/home/vdi/sources/vdi' |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} |
CACHE_MIDDLEWARE_ALIAS | 'default' |
CACHE_MIDDLEWARE_KEY_PREFIX | '********************' |
CACHE_MIDDLEWARE_SECONDS | 600 |
CHANNEL_LAYERS | {'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': {'hosts': [('0.0.0.0', 6379)]}}} |
CKEDITOR_BASEPATH | '/static/ckeditor/ckeditor/' |
CKEDITOR_IMAGE_BACKEND | 'pillow' |
CKEDITOR_UPLOAD_PATH | 'uploads/' |
CSRF_COOKIE_AGE | 31449600 |
CSRF_COOKIE_DOMAIN | None |
CSRF_COOKIE_HTTPONLY | False |
CSRF_COOKIE_NAME | 'csrftoken' |
CSRF_COOKIE_PATH | '/' |
CSRF_COOKIE_SAMESITE | 'Lax' |
CSRF_COOKIE_SECURE | False |
CSRF_FAILURE_VIEW | 'django.views.csrf.csrf_failure' |
CSRF_HEADER_NAME | 'HTTP_X_CSRFTOKEN' |
CSRF_TRUSTED_ORIGINS | [] |
CSRF_USE_SESSIONS | False |
DATABASES | {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'vdi_0705', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '5432', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'vdi'}} |
DATABASE_ROUTERS | [] |
DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 |
DATETIME_FORMAT | '%Y/%m/%d %H:%M:%S' |
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', '%d/%m/%Y'] |
DEBUG | True |
DEBUG_PROPAGATE_EXCEPTIONS | False |
DECIMAL_SEPARATOR | '.' |
DEFAULT_CHARSET | 'utf-8' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
DEFAULT_FILE_STORAGE | 'django.core.files.storage.FileSystemStorage' |
DEFAULT_FROM_EMAIL | 'webmaster@localhost' |
DEFAULT_INDEX_TABLESPACE | '' |
DEFAULT_TABLESPACE | '' |
DISALLOWED_USER_AGENTS | [] |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
EMAIL_HOST | 'localhost' |
EMAIL_HOST_PASSWORD | '********************' |
EMAIL_HOST_USER | '' |
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 | 2621440 |
FILE_UPLOAD_PERMISSIONS | 420 |
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 | ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'channels', 'rest_framework', 'rest_framework.authtoken', 'tracking', 'news', 'management'] |
INTERNAL_IPS | [] |
LANGUAGES | [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('uz', 'Uzbek'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')] |
LANGUAGES_BIDI | ['he', 'ar', 'fa', 'ur'] |
LANGUAGE_CODE | 'en-us' |
LANGUAGE_COOKIE_AGE | None |
LANGUAGE_COOKIE_DOMAIN | None |
LANGUAGE_COOKIE_HTTPONLY | False |
LANGUAGE_COOKIE_NAME | 'django_language' |
LANGUAGE_COOKIE_PATH | '/' |
LANGUAGE_COOKIE_SAMESITE | None |
LANGUAGE_COOKIE_SECURE | False |
LOCALE_PATHS | [] |
LOGGING | {} |
LOGGING_CONFIG | 'logging.config.dictConfig' |
LOGIN_REDIRECT_URL | '/manage/article/' |
LOGIN_URL | '/manage/login/' |
LOGOUT_REDIRECT_URL | None |
MAIL_BOT | 'vdibot@gmail.com' |
MAIL_BOT_PASSWORD | '********************' |
MAIL_SERVER | '74.125.68.109' |
MAIL_SERVER_PORT | 587 |
MANAGERS | [] |
MEDIA_ROOT | '/home/vdi/sources/vdi/media/' |
MEDIA_URL | '/media/' |
MESSAGE_STORAGE | 'django.contrib.messages.storage.cookie.CookieStorage' |
MIDDLEWARE | ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'news.middleware.VisitorTrackingMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] |
MIGRATION_MODULES | {} |
MONTH_DAY_FORMAT | 'F j' |
NUMBER_GROUPING | 0 |
PASSWORD_HASHERS | '********************' |
PASSWORD_RESET_TIMEOUT_DAYS | '********************' |
PREPEND_WWW | False |
REST_FRAMEWORK | {'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication.TokenAuthentication']} |
ROOT_URLCONF | 'news.urls' |
SECRET_KEY | '********************' |
SECURE_BROWSER_XSS_FILTER | False |
SECURE_CONTENT_TYPE_NOSNIFF | True |
SECURE_HSTS_INCLUDE_SUBDOMAINS | False |
SECURE_HSTS_PRELOAD | False |
SECURE_HSTS_SECONDS | 0 |
SECURE_PROXY_SSL_HEADER | None |
SECURE_REDIRECT_EXEMPT | [] |
SECURE_REFERRER_POLICY | None |
SECURE_SSL_HOST | None |
SECURE_SSL_REDIRECT | False |
SERVER_EMAIL | 'root@localhost' |
SESSION_CACHE_ALIAS | 'default' |
SESSION_COOKIE_AGE | 1209600 |
SESSION_COOKIE_DOMAIN | None |
SESSION_COOKIE_HTTPONLY | True |
SESSION_COOKIE_NAME | 'sessionid' |
SESSION_COOKIE_PATH | '/' |
SESSION_COOKIE_SAMESITE | 'Lax' |
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 | 'news.settings' |
SHORT_DATETIME_FORMAT | 'm/d/Y P' |
SHORT_DATE_FORMAT | 'm/d/Y' |
SIGNING_BACKEND | 'django.core.signing.TimestampSigner' |
SILENCED_SYSTEM_CHECKS | [] |
STATICFILES_DIRS | ('/home/vdi/sources/vdi/news/static', '/home/vdi/sources/vdi/management/static') |
STATICFILES_FINDERS | ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
STATIC_ROOT | None |
STATIC_URL | '/static/' |
TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/home/vdi/sources/vdi/news/templates', '/home/vdi/sources/vdi/management/templates'], 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}] |
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 | 'Asia/Ho_Chi_Minh' |
TRACK_ANONYMOUS_USERS | True |
TRACK_IGNORE_STATUS_CODES | [400, 404, 403, 405, 410, 500] |
TRACK_PAGEVIEWS | True |
USE_I18N | True |
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
USE_TZ | True |
USE_X_FORWARDED_HOST | False |
USE_X_FORWARDED_PORT | False |
WSGI_APPLICATION | 'news.wsgi.application' |
XS_SHARING_ALLOWED_METHODS | ['POST', 'GET', 'OPTIONS', 'PUT', 'DELETE'] |
X_FRAME_OPTIONS | 'ALLOWALL' |
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.