Created
November 15, 2014 15:16
-
-
Save thomwiggers/9fc90c42a88e2fe4ba81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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