You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

apps.py 365B

12345678910111213
  1. from django.apps import AppConfig
  2. from django.db.models.signals import post_migrate
  3. from django.utils.translation import gettext_lazy as _
  4. from .management import create_default_site
  5. class SitesConfig(AppConfig):
  6. name = 'django.contrib.sites'
  7. verbose_name = _("Sites")
  8. def ready(self):
  9. post_migrate.connect(create_default_site, sender=self)