new_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.10.7 on 2017-08-03 14:14
  from __future__ import unicode_literals
  
  from django.db import migrations
  from django.contrib.auth.models import Permission
  from django.contrib.contenttypes.models import ContentType
  
  from bluebottle.utils.utils import update_group_permissions
  
  
  def add_group_permissions(apps, schema_editor):
      content_type, _ = ContentType.objects.get_or_create(app_label='homepage', model='homepage')
      permission = Permission.objects.get_or_create(content_type=content_type, codename='api_read_homepage',
                                                    name='Can read homepage through the API')
  
      group_perms = {
          'Anonymous': {
              'perms': ('api_read_homepage',)
          },
          'Authenticated': {
              'perms': ('api_read_homepage',)
          }     
      }
      update_group_permissions(None, group_perms)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
      ]
  
      operations = [
              migrations.RunPython(add_group_permissions)
      ]
  
subject: add migration for homepage permissions