I am using Django 1.7.1 and I pip installed django-filters to my virtual env at /.virtualenvs/auction2/lib/python2.7/site-packages$
It said it was insta
I had a similar issue using django 1.7, djangorestframework==3.2.0 and latest django-filter==0.13.0:
Using DjangoFilterBackend, but django-filter is not installed
cannot import name Expression
I finally fixed it by downgrading django-filter to 0.11.
Now pip freeze looks like this and its working:
Django==1.7
django-filter==0.11.0
djangorestframework==3.2.0
My pip version was old, really old. 1.5.6 When I installed my virtual environment it just worked, so I didn't question. Lesson learned! Here is what I did in case it helps someone else...
In the virtual environment, I installed pip as described in the docs:
https://pip.pypa.io/en/stable/installing.html
python get-pip.py
This upgraded me to pip 6.1.1
pip install django-filter
pip freeze > requirements.txt
Reading requirements.txt showed I had
django-filter==0.9.2
django-filters==0.1.0
So I uninstalled the older version with pip uninstall django-filters
notice the s on the older version but not on the new one
Really basic stuff but it really tripped me up. Thanks to anyone who took time to look into this!
I also had the same issue. Even after installing django-filters
I couldn't import it
ImportError: No module named django_filters
The Django version I'm using is 1.8 and python version is 2.7.x
Solution is to install djangorestframework-filters
pip install djangorestframework-filters
The names are very confusing.
However django-rest-framework-filters
is an extension to Django REST framework and Django filter that makes it easy to filter across relationships while Django-filter
is a reusable Django application allowing users to declaratively add dynamic QuerySet filtering from URL parameters.
I changed from django_filter
to django_filters
in installed apps and it was okay.
I also encountered this issue installing django-filter==2.2.0
This was my Django version:
Django [required: >=1.11, installed: 2.2]
settings.py:
INSTALLED_APPS = [
# ...
'django_filters',
]
I mistakenly installed with:
pipenv install django_filters
This is the correct installation:
pipenv install django-filter
Hope it helps.