ImportError: cannot import name force_text

I have installed python 2.7 and django 1.4 in my centos machine and installed all dependencies for my existing project.When i run "python runserver" i am getting the following traceback in my console.

[root@localhost bv]# python runserver
Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of < object at 0x8ddd7ec>>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/", line 91, in inner_run
  File "/usr/local/lib/python2.7/site-packages/django/core/management/", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/", line 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/local/lib/python2.7/site-packages/django/db/models/", line 158, in get_app_errors
  File "/usr/local/lib/python2.7/site-packages/django/db/models/", line 67, in _populate
  File "/usr/local/lib/python2.7/site-packages/django/db/models/", line 88, in load_app
    models = import_module('.models', app_name)
  File "/usr/local/lib/python2.7/site-packages/django/utils/", line 35, in import_module
  File "/usr/local/lib/python2.7/site-packages/debug_toolbar/", line 6, in <module>
    from debug_toolbar.toolbar.loader import load_panel_classes
  File "/usr/local/lib/python2.7/site-packages/debug_toolbar/toolbar/", line 12, in <module>
    from debug_toolbar.utils.settings import CONFIG
  File "/usr/local/lib/python2.7/site-packages/debug_toolbar/utils/", line 9, in <module>
    from django.utils.encoding import force_text
ImportError: cannot import name force_text


Upgrade to the latest Django 1.4 (as of 07-08-2014 - the "1.4.13").

I see that they have added a shortcut (force_text) in the django.utils.encoding module:

Note, that the shortcut wasn't there in the initial 1.4 version ( and was only added in 1.4.2 (

As stated in the docs of django-debug-toolbar, current version (as of 07-08-2014 - the "1.2.1") works fine on Django 1.4 to 1.7.

Thus, make sure you use latest version of Django 1.4.x and django-debug-toolbar.

Need Your Help

Format my XML output in CakePHP

xml cakephp

I have the players table with three field id, first_name, last_name.

how to insert unique value in mvc

am using mvc,i want to insert a value into the column which is unique. so am checking the column before inserting whether the value exists or not..

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.