get() returned more than one Genre -- it returned 2!
Request Method: | GET |
---|---|
Request URL: | http://www.fast-torrent.ru/zarubezhnyj-film/-/melodrama/ |
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 05:25:37 +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 '/zarubezhnyj-film/-/melodrama/'> |
./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_film at 0x7f99a21744c0> |
callback_args | () |
callback_kwargs | {'slug': 'zarubezhnyj-film', 'tag': 'melodrama'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>> |
request | <WSGIRequest: GET '/zarubezhnyj-film/-/melodrama/'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0> |
wrapped_callback | <function genre_film at 0x7f99a21744c0> |
./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 '/zarubezhnyj-film/-/melodrama/'>,) |
kwargs | {'slug': 'zarubezhnyj-film', 'tag': 'melodrama'} |
view_func | <function genre_film at 0x7f99a2174430> |
././film/views.py
, line 361, in genre_film
def last_films( request, page=1, country=False, tag=False, genre=False, year=False ):
return film_parser( request, 'video', 'order', 'latest', page, selected_tag=tag, selected_country=country, selected_genre=genre, selected_year=year )
@csrf_exempt
def popular_films( request, page=1 , country=False, tag=False, genre=False, year=False ):
return film_parser( request, 'video', 'order', '6_months', page, selected_country=country, selected_tag=tag, selected_genre=genre, selected_year=year )
@csrf_exempt
def genre_film( request, slug, page=1, country=False, tag=False, year=False ):
return film_parser( request, 'video', 'genre', slug, page, selected_tag=tag, selected_country=country, selected_year=year )…
@csrf_exempt
def last_torrent( request, page=1, country=False, tag=False, genre=False, year=False ):
return film_parser( request, 'video', 'order', 'new', page, selected_country=country, selected_tag=tag, selected_genre=genre, selected_year=year )
@csrf_exempt
def last_torrent1( request, page=1, country=False, tag=False, genre=False, year=False ):
return film_parser( request, 'video', 'order', 'new1', page, selected_country=country, selected_tag=tag, selected_genre=genre, selected_year=year )
Variable | Value |
---|---|
country | False |
page | 1 |
request | <WSGIRequest: GET '/zarubezhnyj-film/-/melodrama/'> |
slug | 'zarubezhnyj-film' |
tag | 'melodrama' |
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 '/zarubezhnyj-film/-/melodrama/'>, 'video', 'genre', 'zarubezhnyj-film', 1) |
kwargs | {'selected_country': False, 'selected_tag': 'melodrama', 'selected_year': False} |
view_func | <function film_parser at 0x7f99a2176950> |
././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 | 'fd5c8f191a5b3d2c437a12cd7f2b12e9-1' |
cache_text_id | 'list_content_1-video-genre-zarubezhnyj-film-1-6-15-2024/03/19_00:23:19-melodrama' |
children | False |
content_json | '' |
content_legal | False |
dt | '2024/03/19_00:23:19' |
hide_viewed | False |
list_content_prefix | 'list_content_1' |
m | None |
mode | 'video' |
page | 1 |
pages | '15' |
profile | False |
request | <WSGIRequest: GET '/zarubezhnyj-film/-/melodrama/'> |
selected_country | False |
selected_genre | False |
selected_tag | 'melodrama' |
selected_year | False |
set_hide_viewed | False |
slug | 'zarubezhnyj-film' |
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': 1, 'generic_description': False, 'generic_title': False, 'generic_url': '/zarubezhnyj-film/', 'mode': 'video', 'page': '1', 'page_id': 'empty', 'page_list': ['15', '25', '50'], 'pages': 15, 'slug': 'zarubezhnyj-film', '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: Путаница / Mixed Baggage (2022)>, <Film: Переводчик / The Covenant (2023)>, <Film: На носу / On the Nose (2001)>, <Film: Пришельцы 3: Взятие Бастилии / Les Visiteurs: La Révolution (2016)>, <Film: Мост исчез / Tian qiao bu jian le (2002)>, <Film: Морская погоня / The Sea Chase (1955)>, <Film: Двое в городе / Deux Hommes Dans La Ville (1973)>, <Film: Ступая во мрак / Wander Darkly (2020)>, <Film: Лола / Lola (1981)>, <Film: Джанго / Django (1966)>, <Film: Ника / Nika (2010)>, <Film: Фехтовальщик / Miekkailija (2015)>, <Film: Месть земли / Feng bao (2021)>, <Film: Дзета / Z (1969)>, <Film: Предупреждение / Warning (2021)>, <Film: Классный Мюзикл 2 : Каникулы / High School Musical (2007)>, <Film: Премьер / De Premier (2016)>, <Film: Клей / Glue (2006)>, <Film: Вуду / Voodoo (1995)>, <Film: Ночные налётчики / Night Raiders (2021)>, '...(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 | ['/zarubezhnyj-film/'] |
img | 'video' |
menu_type | ['country', 'genre'] |
mode | 'video' |
musicchannel | False |
page | 1 |
page_canonical | '/zarubezhnyj-film/' |
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 '/zarubezhnyj-film/-/melodrama/'> |
selected_country | False |
selected_genre | 'melodrama' |
selected_tag | False |
selected_type | 'video' |
selected_year | False |
seo | False |
seo_url_title | False |
show_slug | False |
show_top | False |
slug | 'zarubezhnyj-film' |
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: Предупреждение / Warning (2021)>, <Film: Классный Мюзикл 2 : Каникулы / High School Musical (2007)>, <Film: Премьер / De Premier (2016)>, <Film: Клей / Glue (2006)>, <Film: Вуду / Voodoo (1995)>, <Film: Ночные налётчики / Night Raiders (2021)>, <Film: Это правда, если я вру 2 / La vérité si je mens! 2 (2001)>, <Film: Безжалостный 2 / Dead On: Relentless II (1992)>, <Film: Тимбер – говорящая собака / Timber the Treasure Dog (2016)>, <Film: Курьер / The Courier (2012)>, <Film: Обезглавленные / Headless (2015)>, <Film: К радости / Till glädje (1950)>, <Film: Мёртвые девчонки / Dead Girls (1990)>, <Film: Нью-Йорк, Нью-Йорк / Synecdoche, New York (2009)>, <Film: Портрет нимфы / Hua zhong xian (1988)>, <Film: Вторжение / Breaking In (2018)>, <Film: Черная радуга / Black Rainbow (1989)>, <Film: Пляжный отдых по-американски / American Beach House (2015)>, <Film: Тихая семья / The quiet family (1998)>, <Film: Почти мертва / Almost Dead (2016)>, '...(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': 'melodrama'} |
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': 'melodrama'} |
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 | 'www.fast-torrent.ru' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '3.85.63.190' |
HTTP_X_REAL_IP | '3.85.63.190' |
PATH_INFO | '********************' |
QUERY_STRING | '' |
REMOTE_ADDR | '45.142.212.135' |
REMOTE_PORT | '55498' |
REQUEST_METHOD | 'GET' |
REQUEST_SCHEME | 'http' |
REQUEST_URI | '/zarubezhnyj-film/-/melodrama/' |
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.