23 lines
555 B
Python
23 lines
555 B
Python
from django.apps import AppConfig
|
|
from django.conf import settings
|
|
from django.db.models.signals import post_migrate
|
|
|
|
from fet2020.utils import create_perms
|
|
|
|
|
|
def update_default_site(sender, **kwargs):
|
|
from django.contrib.sites.models import Site
|
|
|
|
site = Site.objects.get_current()
|
|
site.domain = settings.HOST_NAME
|
|
site.name = "FET"
|
|
site.save()
|
|
|
|
|
|
class CoreConfig(AppConfig):
|
|
name = "core"
|
|
|
|
def ready(self):
|
|
post_migrate.connect(update_default_site, sender=self)
|
|
post_migrate.connect(create_perms, sender=self)
|