Unsupported lookup 'search' for django.core.exceptions.FieldError

Viewed 604

I'm trying to do a full text search on my postgres db witn Django ORM like this:

Model.objects(column__search='value')

Unfortunately, this query results with this error: django.core.exceptions.FieldError: Unsupported lookup 'search' for TextField or join on the field not permitted.

How to fix that?

1 Answers

The fix was simple. Django's search operator for postgres requires you to add django.contrib.postgres to INSTALLED_APPS in your Django config file.

Related