Needs help with about.html page..

74 views
Skip to first unread message

Sang Won Lee

unread,
May 8, 2016, 6:22:14 AM5/8/16
to General Open edX discussion
I am trying to customize '/edx/app/edxapp/edx-platform/lms/template/static_template/about.html' page.
However whenever I add the following code, and restart lms, I encounter 500 server error


<h1>${_("About")}</h1>
<section>
<div class="photo">
<img src="${static.url('images/executive.png')}" height="100" alt="" />
</div>
</section>

According to the log, it looks like that 'static.url' cannot be recognized during utf-8 conversion.
Any helps would be greatly appreciated :)

Thank you

Error log:
May  8 08:34:19 ip-10-1-0-251 [service_variant=lms][django.request][env:sandbox] ERROR [ip-10-1-0-251  15066] [base.py:256] - Internal Server Error: /about
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 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/static_template_view/views.py", line 49, in render
    return render_to_response('static_templates/' + template, {}, content_type=content_type)
  File "/edx/app/edxapp/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 158, in render_to_response
    return HttpResponse(render_to_string(template_name, dictionary, context_instance, namespace), **kwargs)
  File "/edx/app/edxapp/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 148, 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/35b4de82addd2666f931e3dcd3a9da25/main.html.py", line 256, in render_body
    __M_writer(filters.decode.utf8(self.body()))
  File "/tmp/mako_lms/35b4de82addd2666f931e3dcd3a9da25/static_templates/about.html.py", line 46, in render_body
    __M_writer(filters.decode.utf8(static.url('images/executive.png')))

Andy Armstrong

unread,
May 9, 2016, 10:33:04 AM5/9/16
to edx-...@googlegroups.com
Hi,

It is probably as simple as missing the import of the static namespace, which should look like this:


Let me know if that doesn't fix your issue and I can help you further.

 - Andy

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/29475112-878e-4ac6-8b5c-8abacc8a6183%40googlegroups.com.



--

Andy Armstrong

edX | UI Architect  | an...@edx.org  

141 Portland Street, 9th floor

Cambridge, MA 02139

http://www.edx.org

http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566

bindu rajesh

unread,
May 13, 2016, 7:24:42 PM5/13/16
to edx-...@googlegroups.com
Dear Andy

I have posted the following problem in Open-OPS forum. But could not get any response. It was quite urgent.
Kindly help or refer to someone who can help me on this. First time I am facing such a problem with LMS after the fresh install.



I have installed Dogwood release 3. and successfully setup the environment.
As a staff user or super user, I am able to see all the courses when I find courses to enroll in my LMS dashboard.
However, if I login as learner user (user is active), I don't get to see any courses when I click on "Find Courses" . Even the default account like ho...@example.com, cannot find any courses. For the default accounts, they are already enrolled in Demo course. For new learner users, even Demo course is not appearing in "Find Courses". It was working fine in a master installation I had done before. Is there any change in the Dogwood release? Attached file shows, how my dashboards looks when I find courses.

LMS and NGINX logs are not showing any errors. I can see only following entry corresponding to that time in lms/edx.log
May 13 13:25:32 EDX-TEST [service_variant=lms][edx.footer][env:sandbox] INFO [EDX-TEST  19159] [api.py:286] - Failed to find footer logo at 'themes/edx.org/images/logo.png', using 'images/logo.png' instead

The page that course schedule gives for users to enroll also gives a page not found error. Everything is working fine as a staff user and super user.
I am attaching the screen shots.

Thanks
Bindu Rajesh

about.png
find_courses.png
login.png
Reply all
Reply to author
Forward
0 new messages