get() returned more than one Genre -- it returned 2!
Request Method: | GET |
---|---|
Request URL: | http://fast-torrent.ru/russian-tv/tv/-/drama/ |
Django Version: | 4.1.1 |
Exception Type: | MultipleObjectsReturned |
Exception Value: | get() returned more than one Genre -- it returned 2! |
Exception Location: | ./venv/lib/python3.10/site-packages/django/db/models/query.py, line 653, in get |
Python Executable: | /usr/bin/uwsgi-core |
Python Version: | 3.10.12 |
Python Path: | ['.', '', '/lib/python310.zip', '/lib/python3.10', '/lib/python3.10/lib-dynload', './venv/lib/python3.10/site-packages'] |
Server time: | Tue, 19 Mar 2024 01:22:30 +0000 |
./venv/lib/python3.10/site-packages/django/core/handlers/exception.py
, line 55, in inner
return inner
else:
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | Value |
---|---|
exc | MultipleObjectsReturned('get() returned more than one Genre -- it returned 2!') |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0>> |
request | <WSGIRequest: GET '/russian-tv/tv/-/drama/'> |
./venv/lib/python3.10/site-packages/django/core/handlers/base.py
, line 197, in _get_response
if response is None:
wrapped_callback = self.make_view_atomic(callback)
# If it is an asynchronous view, run it in a subthread.
if asyncio.iscoroutinefunction(wrapped_callback):
wrapped_callback = async_to_sync(wrapped_callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
if response is None:
raise
# Complain if the view returned None (a common error).
Variable | Value |
---|---|
callback | <function genre_parser at 0x7f99a20f57e0> |
callback_args | () |
callback_kwargs | {'slug': 'russian-tv', 'tag': 'drama', 'type': 'tv'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>> |
request | <WSGIRequest: GET '/russian-tv/tv/-/drama/'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0> |
wrapped_callback | <function genre_parser at 0x7f99a20f57e0> |
././film/views.py
, line 488, in genre_parser
'new' :'new',# Последние добавленные
'last' :'latest',# Новинки кино
'latest' :'new1',# Новые фильм на сайте
}
if slug == "popular": return film_parser( request, type, 'order', '6_months', page, selected_tag=tag, selected_country=country, selected_year=year )
if slug in url: return film_parser( request, type, 'order', url[slug], page, selected_tag=tag, selected_country=country, selected_year=year )
else: return film_parser( request, type, 'genre', slug, page, selected_tag=tag, selected_country=country, selected_year=year )…
#-------------------------------------------------------------
def tag_parser( request, mode, slug, page=1, genre=False, tag=False, country=False, year=False ):
Variable | Value |
---|---|
country | False |
page | 1 |
request | <WSGIRequest: GET '/russian-tv/tv/-/drama/'> |
slug | 'russian-tv' |
tag | 'drama' |
type | 'tv' |
url | {'last': 'latest', 'latest': 'new1', 'new': 'new', 'popular': 'top'} |
year | False |
./venv/lib/python3.10/site-packages/django/views/decorators/csrf.py
, line 54, in wrapped_view
def csrf_exempt(view_func):
"""Mark a view function as being exempt from the CSRF view protection."""
# view_func.csrf_exempt = True would also work, but decorators are nicer
# if they don't have side effects, so return a new function.
def wrapped_view(*args, **kwargs):
return view_func(*args, **kwargs)…
wrapped_view.csrf_exempt = True
return wraps(view_func)(wrapped_view)
Variable | Value |
---|---|
args | (<WSGIRequest: GET '/russian-tv/tv/-/drama/'>, 'tv', 'genre', 'russian-tv', 1) |
kwargs | {'selected_country': False, 'selected_tag': 'drama', 'selected_year': False} |
view_func | <function film_parser at 0x7f99a20f5900> |
././film/views.py
, line 654, in film_parser
content_json = ''
else:
content_json = cache.get( cache_key_id, '' )
if len( content_json ) == 0:
content = film_parser_content( request, mode, type, slug, page, pages, selected_genre, selected_tag, selected_country, selected_year, sort )…
if DEBUG:
pass
else:
cache.set( cache_key_id , simplejson.dumps( content, ensure_ascii=False ), CAHCE_FILM_PARSER_TIME )
else:
content = simplejson.loads( content_json )
Variable | Value |
---|---|
DEBUG | False |
cache_key_id | '1f921b39d94fdf059d799d8bf1d0e353-1' |
cache_text_id | 'list_content_1-tv-genre-russian-tv-1-6-15-2024/03/18_14:38:09-drama' |
children | False |
content_json | '' |
content_legal | False |
dt | '2024/03/18_14:38:09' |
hide_viewed | False |
list_content_prefix | 'list_content_1' |
m | None |
mode | 'tv' |
page | 1 |
pages | '15' |
profile | False |
request | <WSGIRequest: GET '/russian-tv/tv/-/drama/'> |
selected_country | False |
selected_genre | False |
selected_tag | 'drama' |
selected_year | False |
set_hide_viewed | False |
slug | 'russian-tv' |
sort | '6' |
type | 'genre' |
url_path | <Genre: Русский сериал> |
././film/views.py
, line 1004, in film_parser_content
url_title += u' %s ' % genre.get_name()
if selected_tag and 'genre' in menu_type:
any = True
selected_genre = selected_tag
selected_tag = False
genre_obj = get_object_or_404( Genre, slug=selected_genre )…
d['video'] = video = video.filter( genre=genre_obj )
url_title += u' %s' % genre_obj.get_name()
url_description += u' С жанром %s.' % genre_obj
url_selected.append( genre_obj )
href_selected.append( genre_obj.get_generic_url( film_type ) )
Variable | Value |
---|---|
any | True |
artist | False |
celebrity | False |
channel | False |
children | False |
company | False |
content_legal | False |
d | {'cache_time': 3600, 'film_type': <Type: Сериалы>, 'film_type_id': 4, 'generic_description': False, 'generic_title': False, 'generic_url': '/russian-tv/', 'mode': 'tv', 'page': '1', 'page_id': 'empty', 'page_list': ['15', '25', '50'], 'pages': 15, 'slug': 'russian-tv', 'sort': '6', 'sort_list': [{'label': 'Основная сортировка'}, {'name': 'Новые', 'value': '6'}, {'name': 'Старые', 'value': '7'}, {'name': 'Лучшие', 'value': '8'}, {'name': 'Популярные', 'value': '2'}, {'name': 'Самые рекомендуемые', 'value': '13'}, {'label': 'Дополнительная сортировка'}, {'name': 'Новые торренты', 'value': '0'}, {'name': 'Ранние торренты', 'value': '1'}, {'name': 'Непопулярные', 'value': '3'}, {'name': 'Название ( А - Я )', 'value': '4'}, {'name': 'Название ( Я - А )', 'value': '5'}, {'name': 'Новые на ДВД', 'value': '14'}, {'name': 'Ранние на ДВД', 'value': '15'}, {'name': 'Худшие по рейтингу', 'value': '9'}, {'name': 'Лучшие по качеству', 'value': '10'}, {'name': 'Худшие по качеству', 'value': '11'}, {'name': 'Новые фильмы на сайте', 'value': '12'}, {'name': 'Обсуждаемые', 'value': '20'}], 'type': 'genre', 'video': <QuerySet [<Film: Телохранители (2023)>, <Film: Контуженный (2023)>, <Film: Выдра (2023)>, <Film: Кибер Иван (2023)>, <Film: СуперИвановы (2023)>, <Film: Морячка (2023)>, <Film: Цифровой код (2023)>, <Film: Кибердеревня (2023)>, <Film: Напарники (2023)>, <Film: Папины дочки. Новые (2023)>, <Film: Ира (2023)>, <Film: Оборотень (2023)>, <Film: Бедные Абрамовичи (2023)>, <Film: Большой дом (2023)>, <Film: Не дождётесь (2023)>, <Film: Секс. До и после (2023)>, <Film: ФК Родина (2023)>, <Film: Галя, у нас отмена (2023)>, <Film: Мендельсон (2023)>, <Film: Бизон: Дело манекенщицы (2023)>, '...(remaining elements truncated)...']>} |
datetime | <module 'datetime' from '/usr/lib/python3.10/datetime.py'> |
distinct | False |
film_type | <Type: Сериалы> |
filter | True |
filter_action | '' |
generic_title | False |
genre | <Genre: Русский сериал> |
href_selected | ['/russian-tv/tv/'] |
img | 'tv' |
menu_type | ['country', 'genre'] |
mode | 'tv' |
musicchannel | False |
page | 1 |
page_canonical | '/russian-tv/tv/' |
page_canonical_list | {'/all/order/6_months/': '/popular/all/', '/all/order/latest/': '/last/all/', '/all/order/new/': '/new/all/', '/all/order/new1/': '/latest/all/', '/documentary/order/6_months/': '/popular/documentary/', '/documentary/order/latest/': '/last/documentary/', '/documentary/order/new/': '/new/documentary/', '/documentary/order/new1/': '/latest/documentary/', '/multfilm/order/6_months/': '/popular-multfilm/', '/multfilm/order/latest/': '/last-multfilm/', '/multfilm/order/new/': '/last-multfilm-torrent/', '/multfilm/order/new1/': '/new-multfilm-movies/', '/music/order/6_months/': '/popular/music/', '/music/order/latest/': '/last/music/', '/music/order/new/': '/new/music/', '/music/order/new1/': '/latest/music/', '/tv/order/6_months/': '/popular-tv/', '/tv/order/latest/': '/last-tv/', '/tv/order/new/': '/last-tv-torrent/', '/tv/order/new1/': '/new-tv-movies/', '/video/order/6_months/': '/most-films/', '/video/order/latest/': '/new-films/', '/video/order/new/': '/new-torrent/', '/video/order/new1/': '/new-movies/'} |
page_today | '2023-2024' |
pages | '15' |
request | <WSGIRequest: GET '/russian-tv/tv/-/drama/'> |
selected_country | False |
selected_genre | 'drama' |
selected_tag | False |
selected_type | 'tv' |
selected_year | False |
seo | False |
seo_url_title | False |
show_slug | False |
show_top | False |
slug | 'russian-tv' |
sort | '6' |
studio | False |
style | False |
tag | False |
type | 'genre' |
url_description | ('Важно! В разделе собраны сериалы, снятые на РУССКОМ языке не зависимо от ' 'страны производства или гражданства режиссера и актеров! Обширный список ' 'русских сериалов на нашем сайте дает возможность по достоинству оценить ' 'новинки телевизионных экранов и') |
url_meta_description | False |
url_meta_keywords | False |
url_path | <Genre: Русский сериал> |
url_selected | [<Genre: Русский сериал>] |
url_text | False |
url_title | 'Новые Русские ' |
video | <QuerySet [<Film: Игра головой (2023)>, <Film: Родные люди (2023)>, <Film: Стой, не то мама будет гадать (2023)>, <Film: Цикады (2023)>, <Film: Дитя раздора (2023)>, <Film: Банда «ЗИГ ЗАГ» (2023)>, <Film: Такси под прикрытием (2023)>, <Film: Саша против! (2023)>, <Film: Отмороженные (2023)>, <Film: Волшебный участок (2023)>, <Film: Ласт квест (2023)>, <Film: Абрек (2023)>, <Film: Настоящий (2023)>, <Film: Праздники (2023)>, <Film: Витязи (2023)>, <Film: Зеркало для оборотня (2023)>, <Film: Звоните в полицию! (2022)>, <Film: Соседка (2023)>, <Film: Уголь (2023)>, <Film: Сама виновата (2023)>, '...(remaining elements truncated)...']> |
./venv/lib/python3.10/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 'film.models.Genre'> |
kwargs | {'slug': 'drama'} |
queryset | <QuerySet [<Genre: Анимация>, <Genre: Аниме>, <Genre: Аниме сериалы>, <Genre: Арт-хаус / Авторское кино>, <Genre: Биография>, <Genre: Боевик>, <Genre: Боевые искусства>, <Genre: Вестерн>, <Genre: Видеоклипы>, <Genre: Военный>, <Genre: Гипотезы>, <Genre: Детектив>, <Genre: Детский>, <Genre: Для взрослых>, <Genre: Документальные сериалы>, <Genre: Документальный>, <Genre: Дополнительные материалы>, <Genre: Драма>, <Genre: Загадки истории>, <Genre: Зарубежные мультфильмы>, '...(remaining elements truncated)...']> |
./venv/lib/python3.10/site-packages/django/db/models/query.py
, line 653, in get
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
)
raise self.model.MultipleObjectsReturned(…
"get() returned more than one %s -- it returned %s!"
% (
self.model._meta.object_name,
num if not limit or num < limit else "more than %s" % (limit - 1),
)
)
Variable | Value |
---|---|
args | () |
clone | <QuerySet [<Genre: драма>, <Genre: Драма>]> |
kwargs | {'slug': 'drama'} |
limit | 21 |
num | 2 |
self | <QuerySet [<Genre: Анимация>, <Genre: Аниме>, <Genre: Аниме сериалы>, <Genre: Арт-хаус / Авторское кино>, <Genre: Биография>, <Genre: Боевик>, <Genre: Боевые искусства>, <Genre: Вестерн>, <Genre: Видеоклипы>, <Genre: Военный>, <Genre: Гипотезы>, <Genre: Детектив>, <Genre: Детский>, <Genre: Для взрослых>, <Genre: Документальные сериалы>, <Genre: Документальный>, <Genre: Дополнительные материалы>, <Genre: Драма>, <Genre: Загадки истории>, <Genre: Зарубежные мультфильмы>, '...(remaining elements truncated)...']> |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
CONTENT_LENGTH | '' |
CONTENT_TYPE | '' |
DOCUMENT_ROOT | '/etc/nginx/html' |
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'fast-torrent.ru' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '54.160.244.62' |
HTTP_X_REAL_IP | '54.160.244.62' |
PATH_INFO | '********************' |
QUERY_STRING | '' |
REMOTE_ADDR | '45.142.212.135' |
REMOTE_PORT | '56348' |
REQUEST_METHOD | 'GET' |
REQUEST_SCHEME | 'http' |
REQUEST_URI | '/russian-tv/tv/-/drama/' |
SCRIPT_NAME | '' |
SERVER_NAME | 'www.fast-torrent.ru' |
SERVER_PORT | '80' |
SERVER_PROTOCOL | 'HTTP/1.0' |
Setting | Value |
---|
You’re seeing this error because you have DEBUG = True
in your
Django settings file. Change that to False
, and Django will
display a standard page generated by the handler for this status code.