defrex/django-encrypted-fields

Error on save

shawnzam opened this issue · 7 comments

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: #23

What version of Python/Django are you using?

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.

Got same issue, python 3.5 and Django 1.10.1

Same issue, python 3.5.2 and Django 1.10.1

Same issue, Python 3.7.1 and Django 1.10.7

Same issue, Python 3.6.1 and Django 1.11.1

I have a PR open to port to Python 3 (#27). Unfortunately it's blocked upstream by keyczar.