# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-22 02:43
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 = 'caliset.net'
        mySite.save()
    else:
        mySite.name = 'CaliSet Local'
        mySite.domain = '127.0.0.1:8000'
        mySite.save()

class Migration(migrations.Migration):
    dependencies = [ ('calligraphy', '0043_auto_20161118_2124') ]
    operations = [ migrations.RunPython(changeHostname) ]
