Getting error while encrypting fields in django model

220 views
Skip to first unread message

Sagar Bhadarka

unread,
Aug 14, 2018, 3:11:56 AM8/14/18
to Django REST framework
Hello,
I am trying to do encryption on the fields that I have in my django model. But I'm getting error. below is the code and library that I used.
I used python-3.6.4, django-2.0.7 and django-cryptography2.3
code:-
from django_cryptography.fields import encrypt


class
Users(models.Model):
username = encrypt(models.CharField(max_length=25, blank=False))

this is the error I'm getting
Unsupported lookup 'iexact' for EncryptedCharField or join on the field not permitted.

Is this the correct method to do it? If is there any other easy and more efficient method available please share.

I refer this example from here.
https://github.com/georgemarshall/django-cryptography
Reply all
Reply to author
Forward
0 new messages