1

I'm using Django 1.4, python 2.7. I want to encrypt data when it gets inserted into DB and decrypt it when I'm reading it from DB. I can override the Save method of each model to store encrypted data but I don't know what should I do when I want to read this data. I have to handle admin site model and my project's models. Which method should I override?

3
  • i think best way is overwrite django Model with new name like EncryptModel this is for one field example Encrypting Database Data in Django | Tyler Lesmann -> tylerlesmann.com/2008/dec/19/encrypting-database-data-django Commented Aug 9, 2012 at 21:42
  • But which method in the model should I overwrite? what is the main method that handles reading data from db? Commented Aug 10, 2012 at 20:42
  • How can I override get method in django Model? - Stack Overflow -> stackoverflow.com/questions/2492653/… Commented Aug 11, 2012 at 6:25

1 Answer 1

1

The EncryptedTextField and EncryptedCharField from django-extensions seem like the things you're looking for.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.