'bootstrap3' is not a valid tag library: ImportError raised loading bootstrap3.templatetags.bootstrap3: cannot import name force_text

StackOverflow https://stackoverflow.com/questions/22144888

Frage

I am going through tutorials on django-bootstrap by this link : "https://pypi.python.org/pypi/django-bootstrap3https://pypi.python.org/pypi/django-bootstrap3"

in my settings.py:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
'example_app',
'southtut',
'south',
'bootstrap3',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',

)

in my templates:

i have written

 {% load bootstrap3 %}

but i am getting the follwoing on the above mentioned line in templates like:

TemplateSyntaxError at /myapp/product/
'bootstrap3' is not a valid tag library: ImportError raised loading     bootstrap3.templatetags.bootstrap3: cannot import name force_text
Request Method: GET
Request URL:    http://127.0.0.1:8000/myapp/product/
Django Version: 1.4.1
Exception Type: TemplateSyntaxError
Exception Value:    
'bootstrap3' is not a valid tag library: ImportError raised loading      bootstrap3.templatetags.bootstrap3: cannot import name force_text
Exception Location: C:\Python27\lib\site-packages\django\template\defaulttags.py in  load, line 1043
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.1
Python Path:    
['C:\\Users\\Gopi\\workspace\\myfirst',
'C:\\Python27\\lib\\site-packages\\geraldo-0.4.16-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\configparser-3.2.0r3-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\unittest2-0.5.1-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\ordereddict-1.1-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\passlib-1.6.1-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\south-0.8.3-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\openpyxl-1.7.0-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\xlutils-1.7.0-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\tesseracttrainer-0.1.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\goslate-1.1.2-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\futures-2.1.6-py2.7.egg',
 'C:\\Windows\\system32\\python27.zip',
'C:\\Python27\\DLLs',
'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27',
'C:\\Python27\\lib\\site-packages',
'C:\\Python27\\lib\\site-packages\\PIL',
'C:\\Python27\\lib\\site-packages\\win32',
'C:\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\Python27\\lib\\site-packages\\Pythonwin',
'C:\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode']
Server time:    Mon, 3 Mar 2014 16:18:18 +0530

I don't know where i was wrong. help me please

War es hilfreich?

Lösung

The error here is "cannot import name force_text" and this is because you use Django 1.4

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top