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

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?

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

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

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

Related

ModuleNotFoundError for model class in django

I ran into the following ModuleNotFoundError error.
File "C:\django-project\CodingWithMitchBlog\demoproject\Blog\api\urls.py", line 3, in <module>
from demoproject.Blog.api.views import api_detail_BlogPost_view
ModuleNotFoundError: No module named 'demoproject.Blog'
'Blog' is my appname.
This is my project structure.
This might be due to incorrect import statements used in the files. If the import statements has the projectname prefixed try removing it and run again.
For example change:
from demoproject.Blog.models import ModelClass
to
from Blog.models import ModelClass
in the urls.py file

I got ImportError and cannot import name Httpresponse from django

I am trying to build a website and I got this error:
ImportError: cannot import name 'Httpresponse' from 'django.http' (C:\Users\vivek\Envs\asvc\lib\site-packages\django\http\__init__.py)
I even tried from django.http
Python is case sensitive, so even though there's no misspelling, the correct sentence would be
from django.http import HttpResponse

django-disqus with django 1.4.8

I'm receiving this error when I add disqus to the INSTALLED_APP:
Error: No module named urllib.parse
I tracked this down to the following line:
from django.utils.http import urlencode
from django.utils.six.moves.urllib.error import URLError
from django.utils.six.moves.urllib.request import (
ProxyHandler,
Request,
urlopen,
build_opener,
install_opener
)
I know that six.moves is not included with django 1.4.8, is there any substitute?
Thanks
Six is an external library, which Django includes for convenience.
You could try installing six separately, and change the imports, for example change
from django.utils.six.moves.urllib.error import URLError
to
from six.moves.urllib.error import URLError

ImportError : cannot import name AppCache

I have installed Django 1.8.3 Then i created my project. I need to import the AppCache but not able to import it. In Django shell i wrote
from django.db.models.loading import AppCache
Error is:
ImportError: cannot import name AppCache
Please help me out.
AppCache is not a part of django.db.models.loading from django 1.7 onwards.For more information you can read this link

Dojango with django 1.5

I'm a django noob. I just added dojango 0.5.5 in project apps. I use Django 1.5 and when i try to vie the test page dojango offers at mysite/dojango/test/ i got this error:
__init__() got an unexpected keyword argument 'namedtuple_as_object'
the error is in the dojango base template file where there is:
'isDebug':{{ DOJANGO.DEBUG|json }},
Has someone encountered this issue? How do you resolve it?
I found a similar issue. Try to find
from django.utils import simplejson as json
and replace it with
try:
import json
except ImportError:
from django.utils import simplejson as json