perf: add a script activate user manually

This commit is contained in:
ibuler
2024-08-20 18:08:03 +08:00
committed by Bryan
parent 6b9fa6e01f
commit b489db8054
2 changed files with 47 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import os
import sys
from django.apps import AppConfig
@@ -12,8 +13,11 @@ class CommonConfig(AppConfig):
from . import signal_handlers # noqa
from . import tasks # noqa
from .signals import django_ready
excludes = ['migrate', 'compilemessages', 'makemigrations']
for i in excludes:
if i in sys.argv:
return
django_ready.send(CommonConfig)
if not os.environ.get('DJANGO_DEBUG_SHELL'):
django_ready.send(CommonConfig)