Return to CodeGreggTiny Wins Home

Django Search

April 10, 2020

Implemented basic search in django using SearchFilter. You can add something this simple to a ViewSet to make fields searchable the search with /apiEndpoint/?search=searchterm

filter_backends = [filters.SearchFilter]
search_fields = ['username', 'email']