Версия Django.

1 year 10 months ago #906 by zhuravel
zhuravel created the topic: Версия Django.
Добрый день. Подскажите, зависит ли работа Simple OPDS Cataloga от версии Django ?

Please Войти or Create an account to join the conversation.

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
1 year 10 months ago #908 by mitshel
mitshel replied the topic: Версия Django.
В общем и целом конечно зависит. По крайней мере тестируется начиная с версии Django 1.8. Будет ли работать на более ранних версиях не знаю.

Please Войти or Create an account to join the conversation.

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
1 year 10 months ago - 1 year 10 months ago #910 by zhuravel
zhuravel replied the topic: Версия Django.
У меня установлена версия Django 1.10 , Python 3.4 , FreeBsd 10 . И некоторые функции не работают.
( сыпят ошибки). Установил ограничение вывод " Количества выдаваемых результатов на одну страницу " . При переходе вперед:
ValueError at /web/catalog/
Environment:


Request Method: GET
Request URL: http://192.168.25.104:8001/web/catalog/?cat=None&page=2

Django Version: 1.10.4
Python Version: 3.4.5
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'opds_catalog',
 'sopds_web_backend']
Installed 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.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.4/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/mnt/sopds/sopds_web_backend/views.py" in CatalogsView
  323.             cat = Catalog.objects.get(id=cat_id)

File "/usr/local/lib/python3.4/site-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/query.py" in get
  376.         clone = self.filter(*args, **kwargs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/query.py" in filter
  796.         return self._filter_or_exclude(False, *args, **kwargs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/query.py" in _filter_or_exclude
  814.             clone.query.add_q(Q(*args, **kwargs))

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in add_q
  1227.         clause, _ = self._add_q(q_object, self.used_aliases)

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in _add_q
  1253.                     allow_joins=allow_joins, split_subq=split_subq,

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in build_filter
  1187.             condition = self.build_lookup(lookups, col, value)

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in build_lookup
  1083.                 return final_lookup(lhs, rhs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/lookups.py" in __init__
  19.         self.rhs = self.get_prep_lookup()

File "/usr/local/lib/python3.4/site-packages/django/db/models/lookups.py" in get_prep_lookup
  59.             return self.lhs.output_field.get_prep_value(self.rhs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/fields/__init__.py" in get_prep_value
  946.         return int(value)

Exception Type: ValueError at /web/catalog/
Exception Value: invalid literal for int() with base 10: 'None'
. И еще одна ошибка
Error during template rendering

In template /mnt/sopds/sopds_web_backend/templates/sopds_books.html, error at line 8
Reverse for 'covertmpl' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
1 	{% extends "sopds_main.html" %}
2 	{% load i18n %}
3 	
4 	{% block body %}
5 	<script>
6 	       function del_bsbook(b_id, b_t) {
7 	           $('#DeleteBook_btnYes').attr("href","{% url "web:bsdel" %}?book="+b_id);
8 	           $('#DeleteBook_image').attr("src","{% url "opds:covertmpl"%}?book="+b_id);
9 	           $('#DeleteBook_title').text(b_t);
10 	           $('#DeleteBookModal').foundation('open');
11 	       }
12 	</script>
13 	           
14 	<div id="DeleteBookModal" class="reveal tiny text-center" data-reveal>
15 	  <h5 id="DeleteBookModalTitle">{% trans "Confirm the deletion of the book to your bookshelf." %}</h5>
16 	  <table><tr>	
17 	  <td width="100px" style="padding:0rem 0rem;">
18 	      <img src="" id="DeleteBook_image" style="max-height: 100px; max-width: 100px">
. Пагинация не работает.
Если установить значение "Количества выдаваемых результатов на одну страницу " по умолчанию, то часть обложек книг не показывается. Ругается на эту строчку
8 	           $('#DeleteBook_image').attr("src","{% url "opds:covertmpl"%}?book="+b_id);
"{% url "opds:covertmpl" %}.
Last Edit: 1 year 10 months ago by zhuravel.

Please Войти or Create an account to join the conversation.

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
1 year 10 months ago #911 by zhuravel
zhuravel replied the topic: Версия Django.
Переустановил версию Django на 1.9.12, Ошибки остались.

Please Войти or Create an account to join the conversation.

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
1 year 10 months ago - 1 year 10 months ago #912 by mitshel
mitshel replied the topic: Версия Django.
SOPDS работает начиная с django 1.8. Разработка ведется в Django 1.10. Поэтому оставляйте Django 1.10.


Теперь по поводу найденных вами ошибок:
Так получилось что несколько ошибок я исправил не меняя версию на сайте, поэтому попробуйте сначала заменить свою версию sopds на новую (на сегодня 0.38) с сайта или Гитхаба. Совершенно однозначно у вас версия, которая содержит ошибки, исправления к которым содержит актуальная версия..
Last Edit: 1 year 10 months ago by mitshel.

Please Войти or Create an account to join the conversation.

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
1 year 10 months ago #918 by zhuravel
zhuravel replied the topic: Версия Django.
Переустановил все заново. Скачал и установил новую версию с Гитхаба. Пагинация в каталогах не работает
Environment:


Request Method: GET
Request URL: http://192.168.25.104:8001/web/catalog/?cat=None&page=2

Django Version: 1.10.4
Python Version: 3.4.5
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'opds_catalog',
 'sopds_web_backend']
Installed 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.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.4/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/mnt/sopds/sopds_web_backend/views.py" in CatalogsView
  323.             cat = Catalog.objects.get(id=cat_id)

File "/usr/local/lib/python3.4/site-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/query.py" in get
  376.         clone = self.filter(*args, **kwargs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/query.py" in filter
  796.         return self._filter_or_exclude(False, *args, **kwargs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/query.py" in _filter_or_exclude
  814.             clone.query.add_q(Q(*args, **kwargs))

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in add_q
  1227.         clause, _ = self._add_q(q_object, self.used_aliases)

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in _add_q
  1253.                     allow_joins=allow_joins, split_subq=split_subq,

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in build_filter
  1187.             condition = self.build_lookup(lookups, col, value)

File "/usr/local/lib/python3.4/site-packages/django/db/models/sql/query.py" in build_lookup
  1083.                 return final_lookup(lhs, rhs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/lookups.py" in __init__
  19.         self.rhs = self.get_prep_lookup()

File "/usr/local/lib/python3.4/site-packages/django/db/models/lookups.py" in get_prep_lookup
  59.             return self.lhs.output_field.get_prep_value(self.rhs)

File "/usr/local/lib/python3.4/site-packages/django/db/models/fields/__init__.py" in get_prep_value
  946.         return int(value)

Exception Type: ValueError at /web/catalog/
Exception Value: invalid literal for int() with base 10: 'None'

Please Войти or Create an account to join the conversation.

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
Time to create page: 0.202 seconds