Skip to main content

Django Model Field that supports AES encryption in MySQL

Project description

Provides an AES field for Django that works with MySQL to do the AES encryption and decryption in the database.



  • Kumar McMillan did a lot of this work.


Like any other field:

from aesfield.field import AESField

class SomeModel(...):
    key = AESField()


AESField takes the following parameters beyond a normal CharField:

  • aes_prefix: the prefix to use on fields, defaults to aes:
  • aes_key: the key to use in the lookup method to find a suitable key for this field, defaults to default


  • AES_METHOD: the module to look in for a key lookup method, if you want something different from the default, aesfield.default
  • AES_KEYS: used by the aesfield.default method. It’s a dictionary of keys to filenames. Those files must be able to be read by the Django process. It must have a default key, unless you specify a specifc one in aes_key


If you add aesfield to INSTALLED_APPS you’ll get one more command, generate_aes_keys. This will generate a new file for each file mentioned in the AES_KEYS dictionary. But only if that file does not already exist.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-mysql-aesfield, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size django-mysql-aesfield-0.2.1.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page