# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-01 23:58
#
#  Sites migrations because I can't figure out how to set Kloud51 to stop redirecting me to davehub.net
#
#############################################
from __future__ import unicode_literals

from django.db import migrations
import socket
from django.contrib.sites.models import Site

def changeHostname(apps, schemd_editor) -> None:
    mySite = Site.objects.get_current()
    if 'calligraphy' in socket.gethostname():
        mySite.name = 'CaliSet'
        mySite.domain = 'davehub.net'
        mySite.save()
    else:
        mySite.name = 'CaliSet Local'
        mySite.domain = '127.0.0.1:8000'
        mySite.save()

class Migration(migrations.Migration):

    dependencies = [
        ('calligraphy', '0044_auto_20161121_1843'),
    ]

    operations = [ migrations.RunPython(changeHostname) ]
