# Change the name and domain of the initial site

from django.db import migrations
from django.contrib.sites.models import Site
from django.conf import settings


def update_site(apps, schema_editor):
    site = Site.objects.get(pk=1)
    site.name = settings.TREE_NAME
    site.domain = settings.PUBLIC_WEB_HOST
    site.save()
        
                                
class Migration(migrations.Migration):

    dependencies = [
        ('procat2', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(update_site),
    ]
