Get
Error during template rendering In template /home/u/freedomregistry/local/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_form.html, error at line 21
Line 21:
› {% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %}
Traceback:
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
response = get_response(request)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
response = self._get_response(request)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/django/template.py" in call
return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
return self._render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
return self.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
return compiled_parent._render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
return self.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
return compiled_parent._render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
return self.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py" in render
return nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/hooks/framework_django.py" in wrapper
return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
result = block.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py" in render
return nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
output = self.filter_expression.resolve(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in resolve
new_obj = func(obj, *arg_vals)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaultfilters.py" in _dec
args[0] = force_text(args[0])
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/encoding.py" in force_text
s = six.text_type(bytes(s), encoding, errors)
Exception Type: UnicodeEncodeError at /admin/qa/answer/8/change/
Exception Value: 'ascii' codec can't encode character u'\u2019' in position 257: ordinal not in range(128)
The cause is `__str__`/`__unicode__` methods of models are being not properly implemented. It must be wrapped with `python_2_unicode_compatible` as described on
https://docs.djangoproject.com/en/1.11/ref/models/instances/#str
Steps to reproduce:
Error during template rendering In template /home/u/freedomregistry/local/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_form.html, error at line 21
Line 21:› {% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %}
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/response.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/response.py" in rendered_content
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/backends/django.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/base.py" in call
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/base.py" in call_if_sampling
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/django/template.py" in call
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/hooks/framework_django.py" in wrapper
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in resolve
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaultfilters.py" in _dec
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/encoding.py" in force_text
Exception Type: UnicodeEncodeError at /admin/qa/answer/8/change/ Exception Value: 'ascii' codec can't encode character u'\u2019' in position 257: ordinal not in range(128)