Field 'id' expected a number but got '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'.
Request Method: | GET |
---|---|
Request URL: | https://webplant.ir/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88 |
Django Version: | 4.2.2 |
Exception Type: | ValueError |
Exception Value: | Field 'id' expected a number but got '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'. |
Exception Location: | /usr/local/lib/python3.11/site-packages/django/db/models/fields/__init__.py, line 2055, in get_prep_value |
Raised during: | articles.views.ArticleDetailView |
Python Executable: | /usr/local/bin/python |
Python Version: | 3.11.4 |
Python Path: | ['/usr/src/app', '/usr/local/bin', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', '/usr/local/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/site-packages'] |
Server time: | Fri, 29 Mar 2024 13:36:55 +0330 |
/usr/local/lib/python3.11/site-packages/django/db/models/fields/__init__.py
, line 2053, in get_prep_value
return validators_
def get_prep_value(self, value):
value = super().get_prep_value(value)
if value is None:
return None
try:
return int(value) ^^^^^^^^^^…
except (TypeError, ValueError) as e:
raise e.__class__(
"Field '%s' expected a number but got %r." % (self.name, value),
) from e
def get_db_prep_value(self, value, connection, prepared=False):
Variable | Value |
---|---|
__class__ | <class 'django.db.models.fields.IntegerField'> |
self | <django.db.models.fields.BigAutoField: id> |
value | '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07' |
/usr/local/lib/python3.11/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 | ValueError("Field 'id' expected a number but got '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'.") |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7fc8bbfb1cd0>> |
request | <WSGIRequest: GET '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88'> |
/usr/local/lib/python3.11/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 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 View.as_view.<locals>.view at 0x7fc8bb506ac0> |
callback_args | () |
callback_kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07', 'title': 'ارث-بری-در-مدل-جنگو'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>> |
request | <WSGIRequest: GET '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7fc8bbfb1cd0> |
wrapped_callback | <function View.as_view.<locals>.view at 0x7fc8bb506ac0> |
/usr/local/lib/python3.11/site-packages/django/views/generic/base.py
, line 104, in view
self = cls(**initkwargs)
self.setup(request, *args, **kwargs)
if not hasattr(self, "request"):
raise AttributeError(
"%s instance has no 'request' attribute. Did you override "
"setup() and forget to call super()?" % cls.__name__
)
return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
view.view_class = cls
view.view_initkwargs = initkwargs
# __name__ and __qualname__ are intentionally left unchanged as
# view_class should be used to robustly determine the name of the view
Variable | Value |
---|---|
args | () |
cls | <class 'articles.views.ArticleDetailView'> |
initkwargs | {} |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07', 'title': 'ارث-بری-در-مدل-جنگو'} |
request | <WSGIRequest: GET '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88'> |
self | <articles.views.ArticleDetailView object at 0x7fc8b94dcbd0> |
/usr/local/lib/python3.11/site-packages/django/views/generic/base.py
, line 143, in dispatch
# request method isn't on the approved list.
if request.method.lower() in self.http_method_names:
handler = getattr(
self, request.method.lower(), self.http_method_not_allowed
)
else:
handler = self.http_method_not_allowed
return handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
def http_method_not_allowed(self, request, *args, **kwargs):
logger.warning(
"Method Not Allowed (%s): %s",
request.method,
request.path,
Variable | Value |
---|---|
args | () |
handler | <bound method BaseDetailView.get of <articles.views.ArticleDetailView object at 0x7fc8b94dcbd0>> |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07', 'title': 'ارث-بری-در-مدل-جنگو'} |
request | <WSGIRequest: GET '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88'> |
self | <articles.views.ArticleDetailView object at 0x7fc8b94dcbd0> |
/usr/local/lib/python3.11/site-packages/django/views/generic/detail.py
, line 108, in get
return super().get_context_data(**context)
class BaseDetailView(SingleObjectMixin, View):
"""A base view for displaying a single object."""
def get(self, request, *args, **kwargs):
self.object = self.get_object() ^^^^^^^^^^^^^^^^^…
context = self.get_context_data(object=self.object)
return self.render_to_response(context)
class SingleObjectTemplateResponseMixin(TemplateResponseMixin):
template_name_field = None
Variable | Value |
---|---|
args | () |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07', 'title': 'ارث-بری-در-مدل-جنگو'} |
request | <WSGIRequest: GET '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88'> |
self | <articles.views.ArticleDetailView object at 0x7fc8b94dcbd0> |
/usr/src/app/articles/views.py
, line 189, in get_object
article=item,
)
return ctx
def get_object(self, *args, **kwargs):
return get_object_or_404(ArticleModel, pk=self.kwargs.get('pk')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
# class AjaxAddCommentView(View):
#
# def post(self, request):
# if not request.user.is_authenticated():
Variable | Value |
---|---|
args | () |
kwargs | {} |
self | <articles.views.ArticleDetailView object at 0x7fc8b94dcbd0> |
/usr/local/lib/python3.11/site-packages/django/shortcuts.py
, line 85, in get_object_or_404
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
)
Variable | Value |
---|---|
args | () |
klass | <class 'articles.models.ArticleModel'> |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'} |
queryset | <QuerySet [<ArticleModel: چت در جنگو با channels>, <ArticleModel: migrate rollback در ترمینال جنگو>, <ArticleModel: تغییر نام نمایشی اپلیکیشن در جنگو>, <ArticleModel: تگ های قالب در جنگو>, <ArticleModel: جنگو ماژول humanize>, <ArticleModel: فرم ها در جنگو>, <ArticleModel: تراشیدن وب (Web Scraping) با پایتون گام اول و دوم>, <ArticleModel: ارث بری در مدل جنگو>, <ArticleModel: متد های QuerySets در جنگو>, <ArticleModel: json چیست؟>, <ArticleModel: وب سوکت در کنار پروتکل http>, <ArticleModel: rabbitmq انواع exchange>, <ArticleModel: کار با Fast Api ساده و سریع>, <ArticleModel: تسک ها با Django-Q>, <ArticleModel: میدلور سفارشی Custom Middleware>]> |
/usr/local/lib/python3.11/site-packages/django/db/models/query.py
, line 623, in get
keyword arguments.
"""
if self.query.combinator and (args or kwargs):
raise NotSupportedError(
"Calling QuerySet.get(...) with filters after %s() is not "
"supported." % self.query.combinator
)
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
Variable | Value |
---|---|
args | () |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'} |
self | <QuerySet [<ArticleModel: چت در جنگو با channels>, <ArticleModel: migrate rollback در ترمینال جنگو>, <ArticleModel: تغییر نام نمایشی اپلیکیشن در جنگو>, <ArticleModel: تگ های قالب در جنگو>, <ArticleModel: جنگو ماژول humanize>, <ArticleModel: فرم ها در جنگو>, <ArticleModel: تراشیدن وب (Web Scraping) با پایتون گام اول و دوم>, <ArticleModel: ارث بری در مدل جنگو>, <ArticleModel: متد های QuerySets در جنگو>, <ArticleModel: json چیست؟>, <ArticleModel: وب سوکت در کنار پروتکل http>, <ArticleModel: rabbitmq انواع exchange>, <ArticleModel: کار با Fast Api ساده و سریع>, <ArticleModel: تسک ها با Django-Q>, <ArticleModel: میدلور سفارشی Custom Middleware>]> |
/usr/local/lib/python3.11/site-packages/django/db/models/query.py
, line 1436, in filter
def filter(self, *args, **kwargs):
"""
Return a new QuerySet instance with the args ANDed to the existing
set.
"""
self._not_support_combined_queries("filter")
return self._filter_or_exclude(False, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
def exclude(self, *args, **kwargs):
"""
Return a new QuerySet instance with NOT (args) ANDed to the existing
set.
"""
Variable | Value |
---|---|
args | () |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'} |
self | <QuerySet [<ArticleModel: چت در جنگو با channels>, <ArticleModel: migrate rollback در ترمینال جنگو>, <ArticleModel: تغییر نام نمایشی اپلیکیشن در جنگو>, <ArticleModel: تگ های قالب در جنگو>, <ArticleModel: جنگو ماژول humanize>, <ArticleModel: فرم ها در جنگو>, <ArticleModel: تراشیدن وب (Web Scraping) با پایتون گام اول و دوم>, <ArticleModel: ارث بری در مدل جنگو>, <ArticleModel: متد های QuerySets در جنگو>, <ArticleModel: json چیست؟>, <ArticleModel: وب سوکت در کنار پروتکل http>, <ArticleModel: rabbitmq انواع exchange>, <ArticleModel: کار با Fast Api ساده و سریع>, <ArticleModel: تسک ها با Django-Q>, <ArticleModel: میدلور سفارشی Custom Middleware>]> |
/usr/local/lib/python3.11/site-packages/django/db/models/query.py
, line 1454, in _filter_or_exclude
if (args or kwargs) and self.query.is_sliced:
raise TypeError("Cannot filter a query once a slice has been taken.")
clone = self._chain()
if self._defer_next_filter:
self._defer_next_filter = False
clone._deferred_filter = negate, args, kwargs
else:
clone._filter_or_exclude_inplace(negate, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
return clone
def _filter_or_exclude_inplace(self, negate, args, kwargs):
if negate:
self._query.add_q(~Q(*args, **kwargs))
else:
Variable | Value |
---|---|
args | () |
clone | <QuerySet [<ArticleModel: چت در جنگو با channels>, <ArticleModel: migrate rollback در ترمینال جنگو>, <ArticleModel: تغییر نام نمایشی اپلیکیشن در جنگو>, <ArticleModel: تگ های قالب در جنگو>, <ArticleModel: جنگو ماژول humanize>, <ArticleModel: فرم ها در جنگو>, <ArticleModel: تراشیدن وب (Web Scraping) با پایتون گام اول و دوم>, <ArticleModel: ارث بری در مدل جنگو>, <ArticleModel: متد های QuerySets در جنگو>, <ArticleModel: json چیست؟>, <ArticleModel: وب سوکت در کنار پروتکل http>, <ArticleModel: rabbitmq انواع exchange>, <ArticleModel: کار با Fast Api ساده و سریع>, <ArticleModel: تسک ها با Django-Q>, <ArticleModel: میدلور سفارشی Custom Middleware>]> |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'} |
negate | False |
self | <QuerySet [<ArticleModel: چت در جنگو با channels>, <ArticleModel: migrate rollback در ترمینال جنگو>, <ArticleModel: تغییر نام نمایشی اپلیکیشن در جنگو>, <ArticleModel: تگ های قالب در جنگو>, <ArticleModel: جنگو ماژول humanize>, <ArticleModel: فرم ها در جنگو>, <ArticleModel: تراشیدن وب (Web Scraping) با پایتون گام اول و دوم>, <ArticleModel: ارث بری در مدل جنگو>, <ArticleModel: متد های QuerySets در جنگو>, <ArticleModel: json چیست؟>, <ArticleModel: وب سوکت در کنار پروتکل http>, <ArticleModel: rabbitmq انواع exchange>, <ArticleModel: کار با Fast Api ساده و سریع>, <ArticleModel: تسک ها با Django-Q>, <ArticleModel: میدلور سفارشی Custom Middleware>]> |
/usr/local/lib/python3.11/site-packages/django/db/models/query.py
, line 1461, in _filter_or_exclude_inplace
clone._filter_or_exclude_inplace(negate, args, kwargs)
return clone
def _filter_or_exclude_inplace(self, negate, args, kwargs):
if negate:
self._query.add_q(~Q(*args, **kwargs))
else:
self._query.add_q(Q(*args, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
def complex_filter(self, filter_obj):
"""
Return a new QuerySet instance with filter_obj added to the filters.
filter_obj can be a Q object or a dictionary of keyword lookup
Variable | Value |
---|---|
args | () |
kwargs | {'pk': '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'} |
negate | False |
self | <QuerySet [<ArticleModel: چت در جنگو با channels>, <ArticleModel: migrate rollback در ترمینال جنگو>, <ArticleModel: تغییر نام نمایشی اپلیکیشن در جنگو>, <ArticleModel: تگ های قالب در جنگو>, <ArticleModel: جنگو ماژول humanize>, <ArticleModel: فرم ها در جنگو>, <ArticleModel: تراشیدن وب (Web Scraping) با پایتون گام اول و دوم>, <ArticleModel: ارث بری در مدل جنگو>, <ArticleModel: متد های QuerySets در جنگو>, <ArticleModel: json چیست؟>, <ArticleModel: وب سوکت در کنار پروتکل http>, <ArticleModel: rabbitmq انواع exchange>, <ArticleModel: کار با Fast Api ساده و سریع>, <ArticleModel: تسک ها با Django-Q>, <ArticleModel: میدلور سفارشی Custom Middleware>]> |
/usr/local/lib/python3.11/site-packages/django/db/models/sql/query.py
, line 1534, in add_q
# type to remain inner. Existing outer joins can however be demoted.
# (Consider case where rel_a is LOUTER and rel_a__col=1 is added - if
# rel_a doesn't produce any rows, then the whole condition must fail.
# So, demotion is OK.
existing_inner = {
a for a in self.alias_map if self.alias_map[a].join_type == INNER
}
clause, _ = self._add_q(q_object, self.used_aliases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
if clause:
self.where.add(clause, AND)
self.demote_joins(existing_inner)
def build_where(self, filter_expr):
return self.build_filter(filter_expr, allow_joins=False)[0]
Variable | Value |
---|---|
existing_inner | set() |
q_object | <Q: (AND: ('pk', '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'))> |
self | <django.db.models.sql.query.Query object at 0x7fc8b92a8b90> |
/usr/local/lib/python3.11/site-packages/django/db/models/sql/query.py
, line 1565, in _add_q
current_negated ^= q_object.negated
branch_negated = branch_negated or q_object.negated
target_clause = WhereNode(connector=connector, negated=q_object.negated)
joinpromoter = JoinPromoter(
q_object.connector, len(q_object.children), current_negated
)
for child in q_object.children:
child_clause, needed_inner = self.build_filter(…
child,
can_reuse=used_aliases,
branch_negated=branch_negated,
current_negated=current_negated,
allow_joins=allow_joins,
split_subq=split_subq,
Variable | Value |
---|---|
allow_joins | True |
branch_negated | False |
check_filterable | True |
child | ('pk', '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07') |
connector | 'AND' |
current_negated | False |
joinpromoter | JoinPromoter(connector='AND', num_children=1, negated=False) |
q_object | <Q: (AND: ('pk', '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07'))> |
self | <django.db.models.sql.query.Query object at 0x7fc8b92a8b90> |
split_subq | True |
summarize | False |
target_clause | <WhereNode: (AND: )> |
used_aliases | {'articles_articlemodel'} |
/usr/local/lib/python3.11/site-packages/django/db/models/sql/query.py
, line 1480, in build_filter
else:
col = MultiColSource(
alias, targets, join_info.targets, join_info.final_field
)
else:
col = self._get_col(targets[0], join_info.final_field, alias)
condition = self.build_lookup(lookups, col, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
lookup_type = condition.lookup_name
clause = WhereNode([condition], connector=AND)
require_outer = (
lookup_type == "isnull" and condition.rhs is True and not current_negated
)
Variable | Value |
---|---|
alias | 'articles_articlemodel' |
allow_joins | True |
allow_many | True |
arg | 'pk' |
branch_negated | False |
can_reuse | {'articles_articlemodel'} |
check_filterable | True |
col | Col(articles_articlemodel, articles.ArticleModel.id) |
current_negated | False |
filter_expr | ('pk', '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07') |
join_info | JoinInfo(final_field=<django.db.models.fields.BigAutoField: id>, targets=(<django.db.models.fields.BigAutoField: id>,), opts=<Options for ArticleModel>, joins=['articles_articlemodel'], path=[], transform_function=<function Query.setup_joins.<locals>.final_transformer at 0x7fc8b9252ac0>) |
join_list | ['articles_articlemodel'] |
lookups | [] |
opts | <Options for ArticleModel> |
parts | ['pk'] |
pre_joins | {} |
reffed_expression | False |
reuse_with_filtered_relation | False |
self | <django.db.models.sql.query.Query object at 0x7fc8b92a8b90> |
split_subq | True |
summarize | False |
targets | (<django.db.models.fields.BigAutoField: id>,) |
used_joins | {'articles_articlemodel'} |
value | '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07' |
/usr/local/lib/python3.11/site-packages/django/db/models/sql/query.py
, line 1307, in build_lookup
# and do an Exact lookup against it.
lhs = self.try_transform(lhs, lookup_name)
lookup_name = "exact"
lookup_class = lhs.get_lookup(lookup_name)
if not lookup_class:
return
lookup = lookup_class(lhs, rhs) ^^^^^^^^^^^^^^^^^^^^^^…
# Interpret '__exact=None' as the sql 'is NULL'; otherwise, reject all
# uses of None as a query value unless the lookup supports it.
if lookup.rhs is None and not lookup.can_use_none_as_rhs:
if lookup_name not in ("exact", "iexact"):
raise ValueError("Cannot use None as a query value")
return lhs.get_lookup("isnull")(lhs, True)
Variable | Value |
---|---|
lhs | Col(articles_articlemodel, articles.ArticleModel.id) |
lookup_class | <class 'django.db.models.lookups.Exact'> |
lookup_name | 'exact' |
lookups | [] |
rhs | '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07' |
self | <django.db.models.sql.query.Query object at 0x7fc8b92a8b90> |
transforms | [] |
/usr/local/lib/python3.11/site-packages/django/db/models/lookups.py
, line 27, in __init__
class Lookup(Expression):
lookup_name = None
prepare_rhs = True
can_use_none_as_rhs = False
def __init__(self, lhs, rhs):
self.lhs, self.rhs = lhs, rhs
self.rhs = self.get_prep_lookup() ^^^^^^^^^^^^^^^^^^^^^^…
self.lhs = self.get_prep_lhs()
if hasattr(self.lhs, "get_bilateral_transforms"):
bilateral_transforms = self.lhs.get_bilateral_transforms()
else:
bilateral_transforms = []
if bilateral_transforms:
Variable | Value |
---|---|
lhs | Col(articles_articlemodel, articles.ArticleModel.id) |
rhs | '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07' |
self | Exact(Col(articles_articlemodel, articles.ArticleModel.id), '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07') |
/usr/local/lib/python3.11/site-packages/django/db/models/lookups.py
, line 341, in get_prep_lookup
self.rhs.clear_select_clause()
self.rhs.add_fields(["pk"])
else:
raise ValueError(
"The QuerySet value for an exact lookup must be limited to "
"one result using slicing."
)
return super().get_prep_lookup() ^^^^^^^^^^^^^^^^^^^^^^^^^…
def as_sql(self, compiler, connection):
# Avoid comparison against direct rhs if lhs is a boolean value. That
# turns "boolfield__exact=True" into "WHERE boolean_field" instead of
# "WHERE boolean_field = True" when allowed.
if (
Variable | Value |
---|---|
Query | <class 'django.db.models.sql.query.Query'> |
__class__ | <class 'django.db.models.lookups.Exact'> |
self | Exact(Col(articles_articlemodel, articles.ArticleModel.id), '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07') |
/usr/local/lib/python3.11/site-packages/django/db/models/lookups.py
, line 85, in get_prep_lookup
self.lhs, self.rhs = new_exprs
def get_prep_lookup(self):
if not self.prepare_rhs or hasattr(self.rhs, "resolve_expression"):
return self.rhs
if hasattr(self.lhs, "output_field"):
if hasattr(self.lhs.output_field, "get_prep_value"):
return self.lhs.output_field.get_prep_value(self.rhs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
elif self.rhs_is_direct_value():
return Value(self.rhs)
return self.rhs
def get_prep_lhs(self):
if hasattr(self.lhs, "resolve_expression"):
Variable | Value |
---|---|
self | Exact(Col(articles_articlemodel, articles.ArticleModel.id), '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07') |
/usr/local/lib/python3.11/site-packages/django/db/models/fields/__init__.py
, line 2055, in get_prep_value
def get_prep_value(self, value):
value = super().get_prep_value(value)
if value is None:
return None
try:
return int(value)
except (TypeError, ValueError) as e:
raise e.__class__( ^^^^^^^^…
"Field '%s' expected a number but got %r." % (self.name, value),
) from e
def get_db_prep_value(self, value, connection, prepared=False):
value = super().get_db_prep_value(value, connection, prepared)
return connection.ops.adapt_integerfield_value(value, self.get_internal_type())
Variable | Value |
---|---|
__class__ | <class 'django.db.models.fields.IntegerField'> |
self | <django.db.models.fields.BigAutoField: id> |
value | '0a88ba3b-6818-4c2f-81f0-1c435f1b4e07' |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
HTTP_ACCEPT | '*/*' |
HTTP_ACCEPT_ENCODING | 'gzip' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'webplant.ir' |
HTTP_REFERER | 'http://webplant.ir/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '35.170.64.185, 10.11.132.54' |
HTTP_X_FORWARDED_HOST | 'webplant.ir' |
HTTP_X_FORWARDED_PORT | '80' |
HTTP_X_FORWARDED_PROTO | 'https' |
HTTP_X_FORWARDED_SERVER | '231027d64dc9' |
HTTP_X_REAL_IP | '10.11.132.54' |
PATH_INFO | '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/ارث-بری-در-مدل-جنگو' |
QUERY_STRING | '' |
RAW_URI | '/articles/detail/0a88ba3b-6818-4c2f-81f0-1c435f1b4e07/%D8%A7%D8%B1%D8%AB-%D8%A8%D8%B1%DB%8C-%D8%AF%D8%B1-%D9%85%D8%AF%D9%84-%D8%AC%D9%86%DA%AF%D9%88' |
REMOTE_ADDR | '127.0.0.1' |
REMOTE_PORT | '37544' |
REQUEST_METHOD | 'GET' |
SCRIPT_NAME | '' |
SERVER_NAME | '127.0.0.1' |
SERVER_PORT | '8000' |
SERVER_PROTOCOL | 'HTTP/1.1' |
SERVER_SOFTWARE | 'gunicorn/20.1.0' |
gunicorn.socket | <socket.socket fd=9, family=2, type=1, proto=0, laddr=('127.0.0.1', 8000), raddr=('127.0.0.1', 37544)> |
wsgi.errors | <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7fc8b96e3490> |
wsgi.file_wrapper | <class 'gunicorn.http.wsgi.FileWrapper'> |
wsgi.input | <gunicorn.http.body.Body object at 0x7fc8b94dfe10> |
wsgi.input_terminated | True |
wsgi.multiprocess | True |
wsgi.multithread | False |
wsgi.run_once | False |
wsgi.url_scheme | 'https' |
wsgi.version | (1, 0) |
webplant.settings
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | {} |
ADMINS | [] |
ALLOWED_HOSTS | ('*', 'webplant.ir', 'www.webplant.ir') |
APPEND_SLASH | True |
AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] |
AUTH_PASSWORD_VALIDATORS | '********************' |
AUTH_USER_MODEL | 'accounts.AccountModel' |
AWS_ACCESS_KEY_ID | '********************' |
AWS_QUERYSTRING_AUTH | False |
AWS_S3_ENDPOINT_URL | 'https://storage.iran.liara.space' |
AWS_S3_FILE_OVERWRITE | False |
AWS_S3_OBJECT_PARAMETERS | {'CacheControl': 'max-age=86400'} |
AWS_SECRET_ACCESS_KEY | '********************' |
AWS_SERVICE_NAME | 'S3' |
AWS_STORAGE_BUCKET_NAME | 'elastic-merkle-n5-vib-bp' |
BASE_DIR | PosixPath('/usr/src/app') |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} |
CACHE_MIDDLEWARE_ALIAS | 'default' |
CACHE_MIDDLEWARE_KEY_PREFIX | '********************' |
CACHE_MIDDLEWARE_SECONDS | 600 |
CALLBACK_URL | 'https://webplant.ir/financial/verify/' |
CKEDITOR_CONFIGS | {'default': {'codeSnippet_theme': 'monokai_sublime', 'extraPlugins': 'codesnippet', 'toolbar': 'full'}, 'limit_cus': {'toolbar': 'Custom', 'toolbar_Custom': [['Bold', 'Link', 'Unlink', 'Image']]}} |
CKEDITOR_UPLOAD_PATH | 'uploads/' |
CORS_ALLOW_ALL_ORIGINS | False |
CSRF_COOKIE_AGE | 31449600 |
CSRF_COOKIE_DOMAIN | None |
CSRF_COOKIE_HTTPONLY | False |
CSRF_COOKIE_MASKED | 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_HEALTH_CHECKS': False, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'db-webplant-v15-03', 'NAME': 'postgres', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': 5432, 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'root'}} |
DATABASE_ROUTERS | [] |
DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 |
DATA_UPLOAD_MAX_NUMBER_FILES | 100 |
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', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M'] |
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_AUTO_FIELD | 'django.db.models.BigAutoField' |
DEFAULT_CHARSET | 'utf-8' |
DEFAULT_EXCEPTION_REPORTER | 'django.views.debug.ExceptionReporter' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
DEFAULT_FILE_STORAGE | 'django.core.files.storage.FileSystemStorage' |
DEFAULT_FROM_EMAIL | 'Webplant Website <webplant.ir@gmail.com>' |
DEFAULT_INDEX_TABLESPACE | '' |
DEFAULT_TABLESPACE | '' |
DISALLOWED_USER_AGENTS | [] |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
EMAIL_HOST | 'smtp.gmail.com' |
EMAIL_HOST_PASSWORD | '********************' |
EMAIL_HOST_USER | 'mehrdad.behname@gmail.com' |
EMAIL_PORT | 587 |
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 | True |
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' |
GOOGLE_RECAPTCHA_SECRET_KEY | '********************' |
IGNORABLE_404_URLS | [] |
INSTALLED_APPS | ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'django_render_partial', 'rest_framework', 'rest_framework.authtoken', 'accounts', 'articles', 'products', 'projects', 'skills', 'asks', 'features', 'snippet', 'supports', 'financials', 'jalali_date', 'ckeditor', 'captcha', 'storages'] |
INTERNAL_IPS | [] |
JALALI_DATE_DEFAULTS | {'Static': {'css': {'all': ['admin/jquery.ui.datepicker.jalali/themes/base/jquery-ui.min.css']}, 'js': ['admin/js/django_jalali.min.js']}, 'Strftime': {'date': '%y/%m/%d', 'datetime': '%H:%M:%S _ %y/%m/%d'}} |
LANGUAGES | [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ar-dz', 'Algerian Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('ckb', 'Central Kurdish (Sorani)'), ('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'), ('ig', 'Igbo'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('ky', 'Kyrgyz'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('ms', 'Malay'), ('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'), ('tg', 'Tajik'), ('th', 'Thai'), ('tk', 'Turkmen'), ('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', 'ar-dz', 'ckb', 'fa', 'ur'] |
LANGUAGE_CODE | 'fa-ir' |
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 | '/' |
LOGIN_URL | '/accounts/login' |
LOGOUT_REDIRECT_URL | '/' |
MANAGERS | [] |
MAX_CONN_AGE | 0 |
MEDIA_ROOT | PosixPath('/usr/src/app/static_cdn/media') |
MEDIA_URL | '/media/' |
MERCHANT_ID | '46398a7c-be2d-485b-aacb-f89c60f13155' |
MESSAGE_STORAGE | 'django.contrib.messages.storage.fallback.FallbackStorage' |
MIDDLEWARE | ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'middleware.SettingMiddleware.SettingInfoMiddleware'] |
MIGRATION_MODULES | {} |
MONTH_DAY_FORMAT | 'F j' |
NUMBER_GROUPING | 0 |
PASSWORD_HASHERS | '********************' |
PASSWORD_RESET_TIMEOUT | '********************' |
PREPEND_WWW | False |
RECAPTCHA_PRIVATE_KEY | '********************' |
RECAPTCHA_PUBLIC_KEY | '********************' |
REST_FRAMEWORK | {'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.IsAuthenticated']} |
ROOT_URLCONF | 'webplant.urls' |
SECRET_KEY | '********************' |
SECRET_KEY_FALLBACKS | '********************' |
SECURE_CONTENT_TYPE_NOSNIFF | True |
SECURE_CROSS_ORIGIN_OPENER_POLICY | 'same-origin' |
SECURE_HSTS_INCLUDE_SUBDOMAINS | False |
SECURE_HSTS_PRELOAD | False |
SECURE_HSTS_SECONDS | 0 |
SECURE_PROXY_SSL_HEADER | ('HTTP_X_FORWARDED_PROTO', 'https') |
SECURE_REDIRECT_EXEMPT | [] |
SECURE_REFERRER_POLICY | 'same-origin' |
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 | 'webplant.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 | [PosixPath('/usr/src/app/src')] |
STATICFILES_FINDERS | ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
STATIC_ROOT | '/usr/src/app/staticfiles' |
STATIC_URL | '/static/' |
STORAGES | {'default': {'BACKEND': 'storages.backends.s3boto3.S3Boto3Storage'}, 'staticfiles': {'BACKEND': 'storages.backends.s3boto3.S3StaticStorage'}} |
TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [PosixPath('/usr/src/app/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', 'django.template.context_processors.request']}}] |
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/Tehran' |
USE_DEPRECATED_PYTZ | False |
USE_I18N | True |
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
USE_TZ | True |
USE_X_FORWARDED_HOST | True |
USE_X_FORWARDED_PORT | False |
WSGI_APPLICATION | 'webplant.wsgi.application' |
X_FRAME_OPTIONS | 'DENY' |
YEAR_MONTH_FORMAT | 'F Y' |
ZP_API_REQUEST | '********************' |
ZP_API_STARTPAY | '********************' |
ZP_API_VERIFY | '********************' |
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.