×
В названия постов этого раздела нужно включать наименование платформы для которой написана инструкция, Например "Ubuntu 12"
обновил (
5 years 10 months ago #2155
by mitshel
mitshel replied the topic: обновил (
Любой URL в SimpleOPDS должен завершаться слэшем, и во всех ответах именно такие ссылки выдает sopds, однако, видимо kybook по какой-то причине удаляет слэши в конце URL. К сожалению у меня отсутствуют устройства Apple для проверки и тестирования именно KyBook. Как только в руках появится что-нибудь из Apple протестирую данную проблему с kybook.
Однако, пока вы можете попробовать закомментировать практически последнюю строку в файле sopds/urls.py, чтобы содержимое правил переадресации выгядело так:
urlpatterns = [
url(r'^opds/', include('opds_catalog.urls', namespace='opds')),
url(r'^web/', include('sopds_web_backend.urls', namespace='web')),
url(r'^admin/', admin.site.urls),
#url(r'^logout/$', logout, {'next_page':'/web/'},name='logout'),
#url(r'^', include('sopds_web_backend.urls', namespace='web', app_name='opds_web_backend')),
#url(r'^', RedirectView.as_view(url=reverse_lazy("web:main"))),
]
В результате такого исправления SimpleOPDS будет просто добавлять конечный слэш в неправильные адреса без слэша, а не переадреовывать на /web/
Однако, пока вы можете попробовать закомментировать практически последнюю строку в файле sopds/urls.py, чтобы содержимое правил переадресации выгядело так:
urlpatterns = [
url(r'^opds/', include('opds_catalog.urls', namespace='opds')),
url(r'^web/', include('sopds_web_backend.urls', namespace='web')),
url(r'^admin/', admin.site.urls),
#url(r'^logout/$', logout, {'next_page':'/web/'},name='logout'),
#url(r'^', include('sopds_web_backend.urls', namespace='web', app_name='opds_web_backend')),
#url(r'^', RedirectView.as_view(url=reverse_lazy("web:main"))),
]
В результате такого исправления SimpleOPDS будет просто добавлять конечный слэш в неправильные адреса без слэша, а не переадреовывать на /web/
Please Войти or Create an account to join the conversation.
- mitshel
- Offline
- Администратор
Less
More
- Posts: 297
- Karma: 8
5 years 10 months ago #2156
by wishuwerehere
wishuwerehere replied the topic: обновил (
урааа, спасибо помогло
Please Войти or Create an account to join the conversation.
- wishuwerehere
- Topic Author
- Offline
- Осваиваюсь на форуме
Less
More
- Posts: 24
5 years 9 months ago - 5 years 9 months ago #2175
by maddisk
maddisk replied the topic: обновил (
Тоже решил не начинать новый топик. Обновил малинку до новой версии, теперь не работает sopds. Выдает следующее:
Environment:
Request Method: GET
Request URL: http://192.168.1.3/lib/
Django Version: 1.11.16
Python Version: 3.5.3
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'opds_catalog',
'sopds_web_backend',
'django.contrib.admin',
'django.contrib.staticfiles',
'constance.backends.database',
'constance']
Installed Middleware:
['django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'opds_catalog.middleware.SOPDSLocaleMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in ensure_connection
213. self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in connect
189. self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in get_new_connection
274. conn = Database.connect(**conn_params)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/__init__.py" in Connect
86. return Connection(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/connections.py" in __init__
204. super(Connection, self).__init__(*args, **kwargs2)
The above exception ((0, '')) was the direct cause of the following exception:
File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/usr/local/lib/python3.5/dist-packages/django/utils/deprecation.py" in __call__
138. response = self.process_request(request)
File "/mnt/library/sopds/opds_catalog/middleware.py" in process_request
56. request.LANG = config.SOPDS_LANGUAGE
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in inner
239. return func(self._wrapped, *args)
File "/usr/local/lib/python3.5/dist-packages/constance/base.py" in __getattr__
19. result = self._backend.get(key)
File "/usr/local/lib/python3.5/dist-packages/constance/backends/database/__init__.py" in get
75. value = self._model._default_manager.get(key=key).value
File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in get
374. num = len(clone)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __len__
232. self._fetch_all()
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in _fetch_all
1121. self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __iter__
53. results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in execute_sql
876. sql, params = self.as_sql()
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in as_sql
441. where, w_params = self.compile(self.where) if self.where is not None else ("", [])
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in compile
373. sql, params = node.as_sql(self, self.connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/where.py" in as_sql
79. sql, params = compiler.compile(child)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in compile
373. sql, params = node.as_sql(self, self.connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/lookups.py" in as_sql
169. lhs_sql, params = self.process_lhs(compiler, connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/lookups.py" in process_lhs
162. db_type = self.lhs.output_field.db_type(connection=connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/fields/__init__.py" in db_type
644. return connection.data_types[self.get_internal_type()] % data
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in __get__
35. res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in data_types
174. if self.features.supports_microsecond_precision:
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in __get__
35. res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/features.py" in supports_microsecond_precision
53. return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in __get__
35. res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in mysql_version
385. with self.temporary_connection() as cursor:
File "/usr/lib/python3.5/contextlib.py" in __enter__
59. return next(self.gen)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in temporary_connection
591. cursor = self.cursor()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in cursor
254. return self._cursor()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in _cursor
229. self.ensure_connection()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in ensure_connection
213. self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.5/dist-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in ensure_connection
213. self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in connect
189. self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in get_new_connection
274. conn = Database.connect(**conn_params)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/__init__.py" in Connect
86. return Connection(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/connections.py" in __init__
204. super(Connection, self).__init__(*args, **kwargs2)
Exception Type: InterfaceError at /
Exception Value: (0, '')
Я так понимаю, что какая-то проблема с подключением к БД. Не силен в Python и Django, по сему даже не знаю в какую сторону копать.
Environment:
Request Method: GET
Request URL: http://192.168.1.3/lib/
Django Version: 1.11.16
Python Version: 3.5.3
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'opds_catalog',
'sopds_web_backend',
'django.contrib.admin',
'django.contrib.staticfiles',
'constance.backends.database',
'constance']
Installed Middleware:
['django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'opds_catalog.middleware.SOPDSLocaleMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in ensure_connection
213. self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in connect
189. self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in get_new_connection
274. conn = Database.connect(**conn_params)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/__init__.py" in Connect
86. return Connection(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/connections.py" in __init__
204. super(Connection, self).__init__(*args, **kwargs2)
The above exception ((0, '')) was the direct cause of the following exception:
File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/usr/local/lib/python3.5/dist-packages/django/utils/deprecation.py" in __call__
138. response = self.process_request(request)
File "/mnt/library/sopds/opds_catalog/middleware.py" in process_request
56. request.LANG = config.SOPDS_LANGUAGE
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in inner
239. return func(self._wrapped, *args)
File "/usr/local/lib/python3.5/dist-packages/constance/base.py" in __getattr__
19. result = self._backend.get(key)
File "/usr/local/lib/python3.5/dist-packages/constance/backends/database/__init__.py" in get
75. value = self._model._default_manager.get(key=key).value
File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in get
374. num = len(clone)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __len__
232. self._fetch_all()
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in _fetch_all
1121. self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __iter__
53. results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in execute_sql
876. sql, params = self.as_sql()
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in as_sql
441. where, w_params = self.compile(self.where) if self.where is not None else ("", [])
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in compile
373. sql, params = node.as_sql(self, self.connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/where.py" in as_sql
79. sql, params = compiler.compile(child)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in compile
373. sql, params = node.as_sql(self, self.connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/lookups.py" in as_sql
169. lhs_sql, params = self.process_lhs(compiler, connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/lookups.py" in process_lhs
162. db_type = self.lhs.output_field.db_type(connection=connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/fields/__init__.py" in db_type
644. return connection.data_types[self.get_internal_type()] % data
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in __get__
35. res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in data_types
174. if self.features.supports_microsecond_precision:
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in __get__
35. res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/features.py" in supports_microsecond_precision
53. return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in __get__
35. res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in mysql_version
385. with self.temporary_connection() as cursor:
File "/usr/lib/python3.5/contextlib.py" in __enter__
59. return next(self.gen)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in temporary_connection
591. cursor = self.cursor()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in cursor
254. return self._cursor()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in _cursor
229. self.ensure_connection()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in ensure_connection
213. self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.5/dist-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in ensure_connection
213. self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py" in connect
189. self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py" in get_new_connection
274. conn = Database.connect(**conn_params)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/__init__.py" in Connect
86. return Connection(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/connections.py" in __init__
204. super(Connection, self).__init__(*args, **kwargs2)
Exception Type: InterfaceError at /
Exception Value: (0, '')
Я так понимаю, что какая-то проблема с подключением к БД. Не силен в Python и Django, по сему даже не знаю в какую сторону копать.
Last Edit: 5 years 9 months ago by maddisk.
Please Войти or Create an account to join the conversation.
- maddisk
- Offline
- Новый участник
Less
More
- Posts: 1
5 years 5 months ago #2190
by wishuwerehere
wishuwerehere replied the topic: обновил (
поставил новую версию (0.47), всё равно ошибка осталась, пришлось поправить, как вы писали
Please Войти or Create an account to join the conversation.
- wishuwerehere
- Topic Author
- Offline
- Осваиваюсь на форуме
Less
More
- Posts: 24
Time to create page: 0.148 seconds