defrex / django-encrypted-fields

This is a collection of Django Model Field classes that are encrypted using Keyczar.
MIT License
193 stars 60 forks source link

Error on save #22

Open shawnzam opened 8 years ago

shawnzam commented 8 years ago

I am getting the following error when trying to do a create

[Wed Aug 24 16:18:39 2016] [error]   File "/home/vagrant/.virtualenvs/turktools/lib/python3.4/site-packages/encrypted_fields/fields.py", line 163, in to_python
[Wed Aug 24 16:18:39 2016] [error]     if value is None or not isinstance(value, types.StringTypes):
[Wed Aug 24 16:18:39 2016] [error] AttributeError: 'module' object has no attribute 'StringTypes'

Full trace: http://dpaste.com/0SWTFF9

with my models.py setup:

from django.db import models
from django.contrib.auth.models import User
from encrypted_fields import EncryptedCharField

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    aws_key = EncryptedCharField(max_length=50)
    aws_secret_key = EncryptedCharField(max_length=50)

Any ideas?

[UPDATE:] I added a pull request: https://github.com/defrex/django-encrypted-fields/pull/23

defrex commented 8 years ago

What version of Python/Django are you using?

shawnzam commented 8 years ago

Django Version: 1.9.9 Python Version: 3.4.4

The pull request I submitted works with these versions. But they break support for < versions.

aleosd commented 7 years ago

Got same issue, python 3.5 and Django 1.10.1

yeonsh commented 7 years ago

Same issue, python 3.5.2 and Django 1.10.1

DEKHTIARJonathan commented 7 years ago

Same issue, Python 3.7.1 and Django 1.10.7

VadymRud commented 7 years ago

Same issue, Python 3.6.1 and Django 1.11.1

defrex commented 7 years ago

I have a PR open to port to Python 3 (https://github.com/defrex/django-encrypted-fields/pull/27). Unfortunately it's blocked upstream by keyczar.