Несколько вопросов по Sopds

1 year 9 months ago #949 by zhuravel
zhuravel created the topic: Несколько вопросов по Sopds
Добрый день. Подскажите, если правильно понимаю, для работы sopds необходимо его запускать командой
1.7 Запускаем встроенный HTTP/OPDS сервер

	python3 manage.py sopds_server start --daemon
без этого он работать не будет? Подскажите, какое преимущество дает это:
Однако наилучшим способом, все же является настройка в качестве HTTP/OPDS серверов Apache или Nginx 
(точка входа ./sopds/wsgi.py)

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

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
1 year 9 months ago #950 by zhuravel
zhuravel replied the topic: Несколько вопросов по Sopds
Если он должен быть запущен . Пытаюсь сделать автозагрузку при старте сервера выполнив команду:
/usr/local/bin/python3 /usr/local/www/sopds/manage.py sopds_server start --daemon
, после этого в логе ошибка
[02/Jan/2017 21:31:54] "GET / HTTP/1.1" 200 12565
Internal Server Error: /opds/cover/159963/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0421' in position 16: ordinal not in range(128)
. Если войти по ssh и выполнить команду
python3 manage.py sopds_server start --daemon
, то все нормально. Но это не очень удобно, т.к. приходится подключаться по ssh и выполнять запуск sopds. Может подскажите, как эту ошибку обойти?

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

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
1 year 9 months ago - 1 year 9 months ago #951 by mitshel
mitshel replied the topic: Несколько вопросов по Sopds
Попробуйте перед тем как запускать sopds_server выполнить следующие команды:
export LANG=ru_RU.UTF-8
export LC_ALL=ru_RU.UTF-8
Last Edit: 1 year 9 months ago by mitshel.

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
1 year 9 months ago #953 by zhuravel
zhuravel replied the topic: Несколько вопросов по Sopds
Все так и осталось. Если использовать автозапуск сервера
[03/Jan/2017 21:05:17] "GET / HTTP/1.1" 200 12507
Internal Server Error: /opds/cover/60592/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u041a' in position 16: ordinal not in range(128)
Internal Server Error: /opds/cover/51534/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0418' in position 16: ordinal not in range(128)
Internal Server Error: /opds/cover/162062/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0421' in position 16: ordinal not in range(128)
Internal Server Error: /opds/cover/171771/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0422' in position 16: ordinal not in range(128)
Internal Server Error: /opds/cover/175610/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0427' in position 16: ordinal not in range(128)
Internal Server Error: /opds/cover/159963/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0421' in position 16: ordinal not in range(128)
[03/Jan/2017 21:05:19] "GET /opds/cover/51534/ HTTP/1.1" 500 69563
[03/Jan/2017 21:05:19] "GET /opds/cover/60592/ HTTP/1.1" 500 69489
Internal Server Error: /opds/cover/175603/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0427' in position 16: ordinal not in range(128)
[03/Jan/2017 21:05:20] "GET /opds/cover/175610/ HTTP/1.1" 500 69643
[03/Jan/2017 21:05:20] "GET /opds/cover/162062/ HTTP/1.1" 500 69519
Internal Server Error: /opds/cover/114725/
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/www/sopds/opds_catalog/dl.py", line 116, in Cover
    fz=codecs.open(full_path, "rb")
  File "/usr/local/lib/python3.4/codecs.py", line 891, in open
    file = builtins.open(filename, mode, buffering)
UnicodeEncodeError: 'ascii' codec can't encode character '\u041c' in position 16: ordinal not in range(128)
[03/Jan/2017 21:05:21] "GET /opds/cover/171771/ HTTP/1.1" 500 69419
[03/Jan/2017 21:05:22] "GET /opds/cover/10636/ HTTP/1.1" 200 29941
[03/Jan/2017 21:05:22] "GET /opds/cover/175603/ HTTP/1.1" 500 69676
[03/Jan/2017 21:05:22] "GET /opds/cover/159963/ HTTP/1.1" 500 69555
[03/Jan/2017 21:05:22] "GET /opds/cover/114725/ HTTP/1.1" 500 69685

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

  • zhuravel
  • zhuravel's Avatar Topic Author
  • Offline
  • Захожу иногда
  • Захожу иногда
More
1 year 9 months ago - 1 year 9 months ago #957 by mitshel
mitshel replied the topic: Несколько вопросов по Sopds
Мне кажется какая-то проблема с Локалью в вашей системе:
Попробуйте добавить в файл /etc/sysconfig/i18n (возможно придется создать этот файл) следующие строки:
LANG=ru_RU.UTF-8
LC_ALL=ru_RU.UTF-8
Last Edit: 1 year 9 months ago by mitshel.

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
1 year 9 months ago - 1 year 9 months ago #965 by zhuravel
zhuravel replied the topic: Несколько вопросов по Sopds
В FreeBsd /etc/sysconfig/i18n нет. Моя локаль
root@FreeBsd:/ # locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_ALL=ru_RU.UTF-8
root@FreeBsd:/ #
На странице не грузятся обложки, и из-за этого и ошибки в логе сервера. Хотя, если в консоли запустить сервер, то все нормально.
Last Edit: 1 year 9 months ago by zhuravel.

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

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