Skip to content

Instantly share code, notes, and snippets.

@thomwiggers
Created November 15, 2014 15:16
Show Gist options
  • Select an option

  • Save thomwiggers/9fc90c42a88e2fe4ba81 to your computer and use it in GitHub Desktop.

Select an option

Save thomwiggers/9fc90c42a88e2fe4ba81 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def insert_sites(apps, schema_editor):
"""Populate the sites model"""
Site = apps.get_model('sites', 'Site')
Site.objects.all().delete()
Site.objects.create(domain='create.tourtodo.com', name='create')
Site.objects.create(domain='www.tourtodo.com', name='www')
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
('gamemaker', '0004_auto_20141108_1303')
]
operations = [
migrations.RunPython(insert_sites)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment