This is possible with public key encryption. I did something similar before in PHP, but the idea for a Django application is the same:
All data on this website was stored in encrypted form using the private key stored in the system software. The corresponding public key for decrypting the data was stored by the client in a text file.
When the client wanted to access their data, they inserted the public key into the authorization form (holding the key in the session), which unlocked the data.
When this is over, they canceled their session authorization.
This protected the information from authorized access to the web application (so safe for weak users / passwords), as well as from database-level leaks.
This is not yet completely secure: if you have root access to the computer, you can grab the key as it is downloaded or view session information. To do this, you could run the reading software on the client machine and access the database through the API.
I understand that this is an old question, but I thought that I would clarify that this is really possible.
source share