python - 导入 django_filters.rest_framework 错误

标签 python django django-rest-framework django-filters

当我按照 this tutorial 尝试使用 django rest 框架过滤器时出现错误.当我尝试导入库时出现错误:

from django_filters.rest_framework import DjangoFilterBackend

错误信息是

ImportError: No module named 'django_filters.rest_framework'

仅供引用,我正在使用这些版本的库:

Django==1.10.3
django-crispy-forms==1.6.1
django-filter==0.11.0
djangorestframework==3.5.3

谢谢

最佳答案

django-filter 在 0.15 release 中添加了 rest_framework 子包.问题是您的环境最初安装了 0.11。

关于python - 导入 django_filters.rest_framework 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41404603/

相关文章:

django - 我可以重定向到 django TemplateView 中的另一个 url 吗?

javascript - Angularjs - 未在 Safari 中添加授权 header

python - 使用 Django Rest Framework 时如何访问请求正文并避免获取 RawPostDataException

python - 为什么即使子进程已完成,Popen.poll() 也会返回 None 的返回码?

python - 将纬度、经度转换为距赤道的距离(以公里为单位)并将四舍五入转换为最近的公里

python - Python PIL 中的重叠多边形

python - 模板中的django select_related

django - 部署到 AWS 时防止覆盖 SQLite3 数据库

python - 大型 django rest 框架应用程序的目录结构

python - 多索引 pandas 数据框中两个不同日期的分组总和之间的差异