Здравствуйте! Возникает ошибка при обращении к базе.
Nov 4 21:15:31 ubuntu [service_variant=lms][django.request][env:sandbox] ERROR [ubuntu 2291] [base.py:256] - Internal Server Error: /admin/certificates/certificatehtmlviewconfiguration/
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
response = response.render()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/response.py", line 158, in render
self.content = self.rendered_content
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/response.py", line 135, in rendered_content
content = template.render(context, self._request)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
return self.template.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 210, in render
return self._render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
return self.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render
return compiled_parent._render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
return self.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render
return compiled_parent._render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
return self.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 1273, in render
_dict = func(*resolved_args, **resolved_kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py", line 388, in date_hierarchy
} for month in months]
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 162, in __iter__
self._fetch_all()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
self._result_cache = list(self.iterator())
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 1217, in iterator
for row in compiler.results_iter():
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 800, in results_iter
row = self.apply_converters(row, converters)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 784, in apply_converters
value = converter(value, expression, self.connection, self.query.context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/expressions.py", line 927, in convert_value
"Database returned an invalid value in QuerySet.datetimes(). "
ValueError: Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?Nov 4 21:15:31 ubuntu [service_variant=lms][django.request][env:sandbox] ERROR [ubuntu 2291] [base.py:256] - Internal Server Error: /admin/certificates/certificatehtmlviewconfiguration/
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
response = response.render()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/response.py", line 158, in render
self.content = self.rendered_content
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/response.py", line 135, in rendered_content
content = template.render(context, self._request)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
return self.template.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 210, in render
return self._render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
return self.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render
return compiled_parent._render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
return self.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render
return compiled_parent._render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
return self.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
bit = self.render_node(node, context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
return node.render(context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/template/base.py", line 1273, in render
_dict = func(*resolved_args, **resolved_kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py", line 388, in date_hierarchy
} for month in months]
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 162, in __iter__
self._fetch_all()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
self._result_cache = list(self.iterator())
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 1217, in iterator
for row in compiler.results_iter():
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 800, in results_iter
row = self.apply_converters(row, converters)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 784, in apply_converters
value = converter(value, expression, self.connection, self.query.context)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/expressions.py", line 927, in convert_value
"Database returned an invalid value in QuerySet.datetimes(). "
ValueError: Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?
установил время на сервере на utc (Europe/Kiev) при помощи dpkg-reconfigure tzdata
добавил в /etc/mysql/my.cnf
после [mysqld]
строку default-time-zone = 'UTC'
Рестартнул Mysql и сделал mysql -u root -p -e "flush tables;" mysql
, но ничего не изменилось, уже голову сломал. Помогите пожалуйста.
import pytz
в вашем virtualenv, в котором ошибку получили? Чтобы установить (если системные пакеты видны):sudo apt-get install python{,3}-tz
иначе:pip install pytz
. Не стесняйтесь полный traceback приводить--это может с отладкой помочь.