1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Django rest framework browsable API filters backend not showing

Discussão em 'Python' iniciado por Stack, Setembro 7, 2025.

  1. Stack

    Stack Membro Participativo

    I can't get the browsable API to show the "Filters" button after configuring django to use the filtering backend.

    According to the documentation all I need to do is add the following few lines of code into the site's settings.py file and the filters should automatically be in the browsable API's web interface, and I just don't see it there. I tried restarting the web server (I'm working with ./manage runserver) and that didn't help.

    EDIT:

    I know there's another option to turn the filters on a view-basis, but I want to have them on for all views.

    According to documentation, it should be enough to do only one of those:


    The default filter backends may be set globally, using the DEFAULT_FILTER_BACKENDS setting.
    ​

    or following:


    You can also set the filter backends on a per-view, or per-viewset basis
    ​

    From settings.py:

    REST_FRAMEWORK = {

    <snip>

    'DEFAULT_FILTER_BACKENDS': (
    'django_filters.rest_framework.DjangoFilterBackend',
    ),


    Following content of pip freeze:

    (venv) mba15:server nir$ pip freeze | grep django
    django-allauth==0.28.0
    django-celery==3.1.17
    django-filter==0.15.3
    django-registration-redux==1.4
    django-rest-auth==0.8.2
    djangorestframework==3.5.3

    Continue reading...

Compartilhe esta Página