-1
我一直試圖讓這個主題開放給予edX工作(基於Django的),我得到這個錯誤在管理日誌 -Django的錯誤 - AttributeError的:「CourseOverview」對象有沒有屬性「start_datetime_text」
AttributeError: 'CourseOverview' object has no attribute 'start_datetime_text'
整個錯誤是這樣的 -
May 14 11:43:36 ip-172-26-15-154 [service_variant=lms][django.request][env:sandbox] ERROR [ip-172-26-15-154 20450] [base.py:256] - Internal Server Error:/ Traceback (most recent call last): File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner return func(*args, **kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view response = view_func(request, *args, **kwargs) File "/edx/app/edxapp/edx-platform/common/djangoapps/util/cache.py", line 78, in wrapper response = view_func(request, *args, **kwargs) File "/edx/app/edxapp/edx-platform/lms/djangoapps/branding/views.py", line 94, in index return student.views.index(request, user=request.user) File "/edx/app/edxapp/edx-platform/common/djangoapps/student/views.py", line 221, in index return render_to_response('index.html', context) File "/edx/app/edxapp/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 198, in render_to_response return HttpResponse(render_to_string(template_name, dictionary, context_instance, namespace, request), **kwargs) File "/edx/app/edxapp/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 188, in render_to_string return template.render_unicode(**context_dictionary) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/mako/template.py", line 454, in render_unicode as_unicode=True) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/mako/runtime.py", line 829, in _render **_kwargs_for_callable(callable_, data)) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/mako/runtime.py", line 864, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/mako/runtime.py", line 890, in _exec_template callable_(context, *args, **kwargs) File "/tmp/mako_lms/c11f9c5f254718c770fcf021e95ac093/main.html.py", line 286, in render_body __M_writer(filters.decode.utf8(self.body())) File "/tmp/mako_lms/c11f9c5f254718c770fcf021e95ac093/marvel-theme-eucalyptus/lms/templates/index.html.py", line 54, in render_body runtime._include_file(context, (courses_list), _template_uri) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/mako/runtime.py", line 752, in _include_file callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs)) File "/tmp/mako_lms/c11f9c5f254718c770fcf021e95ac093/marvel-theme-eucalyptus/lms/templates/courses_list.html.py", line 44, in render_body runtime._include_file(context, u'course.html', _template_uri, course=course) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/mako/runtime.py", line 752, in _include_file callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs)) File "/tmp/mako_lms/c11f9c5f254718c770fcf021e95ac093/marvel-theme-eucalyptus/lms/templates/course.html.py", line 60, in render_body __M_writer(filters.html_escape(filters.decode.utf8(course.start_datetime_text()))) AttributeError: 'CourseOverview' object has no attribute 'start_datetime_text'
問題(一說是給錯誤 - course.html.py)的文件是在這裏 https://pastebin.com/0S79hhDa
您是否需要運行數據庫遷移?這些往往導致類似這樣的錯誤。 –
將您的文件名改爲course.py – Exprator
@Exprator你確定嗎?我認爲目錄中的所有文件都被命名爲[*] .html.py,其他文件工作正常 –