lib.itmens/common/apps.py

23 lines
481 B
Python
Raw Normal View History

2020-05-01 22:46:15 +08:00
from django.apps import AppConfig
from django.core.checks import Tags, register
from django.db.models.signals import post_migrate
2020-05-01 22:46:15 +08:00
class CommonConfig(AppConfig):
2023-01-11 19:11:31 -05:00
name = "common"
def ready(self):
post_migrate.connect(self.setup, sender=self)
def setup(self, **kwargs):
from .setup import Setup
Setup().run()
@register(Tags.admin, deploy=True)
def setup_check(app_configs, **kwargs):
from .setup import Setup
return Setup().check()