DjangoGuy
DjangoGuy

Reputation: 103

Invalid template library specified. ImportError raised when trying to load 'bootstrap3.templatetags.bootstrap3': cannot import name 'flatatt'

I don't know what happened but all of the sudden i am getting this error:

Invalid template library specified. ImportError raised when trying to load 'bootstrap3.templatetags.bootstrap3': cannot import name 'flatatt'

any ideas?

Upvotes: 1

Views: 9241

Answers (3)

Odiljon Djamalov
Odiljon Djamalov

Reputation: 879

I had also such problem and I found the way like this!

1-step) in components.py file in venv\Lib\site-packages\bootstrap3
it was written :

from django.forms.widgets import flatatt

you should change it to from django.forms.utils import flatatt

2-step)in utils.py file in folder venv\Lib\site-packages\bootstrap3 it was written :

from django.forms.widgets import flatatt

you should change it to :

from django.forms.utils import flatatt

Upvotes: 0

obotezat
obotezat

Reputation: 1135

Also you can get the latest version of django-bootstrap3 . That fixed it for me.

Upvotes: 5

Exprator
Exprator

Reputation: 27503

look for the file which gives the error

and change the line having flatatt in the import to the given line

from django.forms.utils import flatatt

Upvotes: 3

Related Questions