@receiver(signals.post_save, sender=admin_models.Domain)
def create_domain_limits(sender, instance, **kwargs):
    if not kwargs.get("created"):
        return
    for name, definition in utils.get_domain_limit_templates():
        max_value = int(
            parameters.get_admin("DEFLT_DOMAIN_{}_LIMIT".format(name.upper())))
        models.DomainObjectLimit.objects.create(
            domain=instance, name=name, max_value=max_value)
Create limits for new domain.
dataset/ETHPy150Open tonioo/modoboa/modoboa/limits/handlers.py/create_domain_limits