Ask Your Question

How to resolve AttributeError upgrading to 0.9.x?

asked 2017-11-29 04:22:00 -0600

Rupreck gravatar image

Have attempted to upgrade from 0.7.53 to 0.9.x and get the following error. The migrations have succeeded after some number of reattempts, rollbacks, server restores. The step through 0.8.2 was successful:

AttributeError at /questions/
'unicode' object has no attribute 'get'
Request Method: GET
Request URL:
Django Version: 1.7.11
Exception Type: AttributeError
Exception Value:    
'unicode' object has no attribute 'get'
Exception Location: /usr/local/lib/python2.7/dist-packages/askbot/models/ in user_get_avatar_url, line 236
Python Executable:  /usr/bin/python
Python Version: 2.7.12
Python Path:    
Server time:    Wed, 29 Nov 2017 10:04:40 +0000



Request Method: GET
Request URL:

Django Version: 1.7.11
Python Version: 2.7.12
Installed Applications:
Installed Middleware:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/askbot/views/" in questions
  287.         return render(request, 'main_page.html', template_data)
File "/usr/local/lib/python2.7/dist-packages/django/" in render
  50.     return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/usr/local/lib/python2.7/dist-packages/django/template/" in render_to_string
  178.         return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/coffin/template/" in render
  55.         return super(Template, self).render(**context)
File "/usr/local/lib/python2.7/dist-packages/jinja2/" in render
  989.         return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python2.7/dist-packages/jinja2/" in handle_exception
  754.         reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/main_page.html" in top-level template code
  2. {% import "macros.html" as macros %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html" in top-level template code
  1. {% extends "base.html" %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/base.html" in top-level template code
  45.             {% block body %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html" in block "body"
  9.     {% block sidebar%}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/main_page.html" in block "sidebar"
  27.     {% include "main_page ...
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-12-10 12:49:21 -0600

Rupreck gravatar image

The cause of this error is coding related to the JSONField type used for avatar_urls. Changes to in askbot/models to comment out the assignment to that variable in 3 places permits the site to load. (lines 235,239 and 319 in the github master codebase and published releases 9 and 10 trigger the error.

edit flag offensive delete link more

answered 2017-11-29 14:40:27 -0600

You are upgrading from 7.x branches to 9.x branches but keep in mind that both django versions are different for both the Askbot instances

When you upgrade AskBot, you should run given commands:

For version 9.x and 10.x

python makemigrations
python migrate

For version 7.x and 8.x

python syncdb
edit flag offensive delete link more


Thanks for the contribution but this is not the answer. These commands were run and the migration process succeeded.

Rupreck gravatar imageRupreck ( 2017-11-29 22:19:26 -0600 )edit

Provide more details including which stack you are using in which distro including complete details.

gopalraha gravatar imagegopalraha ( 2017-12-01 03:42:37 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-11-29 04:22:00 -0600

Seen: 191 times

Last updated: Dec 10 '17