Django Setting up HStoreField


Example

First, we'll need to do some setup to get HStoreField working.

  1. make sure django.contrib.postgres is in your `INSTALLED_APPS
  2. Add HStoreExtension to your migrations. Remember to put HStoreExtension before any CreateModel or AddField migrations.
from django.contrib.postgres.operations import HStoreExtension
from django.db import migrations

class FooMigration(migrations.Migration):
    # put your other migration stuff here
    operations = [
        HStoreExtension(),
        ...
    ]