[Answer]-Django field lookup returns case-insensitive result even with __exact

1👍

âś…

It has to do with the collation of your database, specially if you are using MySQL. See the documentation here:
https://docs.djangoproject.com/en/1.6/ref/models/querysets/#std:fieldlookup-exact

It says:
In MySQL, a database table’s “collation” setting determines whether exact comparisons are case-sensitive. This is a database setting, not a Django setting.

Which means, it’s the setting on your database that determines the case-sensitivity not what you write in python.

Leave a comment